Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Standard C Libraries in OS X Dev Tools

Standard C Libraries in OS X Dev Tools
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2001
Location: US
Status: Offline
Reply With Quote
Oct 19, 2001, 01:34 AM
 
I would like to learn a bit more about the plain C language and then hopefully start to learn OS X programming using Carbon. I installed the OS X 10.1 developer tools and looked around but can't seem to find the standard C libraries (C headers files) that I could do plain C programming with. Could anyone confirm yes or no on that? If no, it is possible to get them from somewhere? Also on that subject, CodeWarrior included SIOUX to help plain C programs run on the Mac, is there something similar included with the OS X dev tools?
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Boulder, CO, USA
Status: Offline
Reply With Quote
Oct 19, 2001, 02:25 AM
 
Try /usr/include. Most non-framework stuff can be found by rooting around in there. (If you want to use the finder to navigate instead of the terminal, you can type "open /usr/include/" at the command line to open a Finder window. This is necessary because the folder's hidden by default...)

Also, /usr/lib/ has the actual libraries against which you must link.

As for a SOUIX-like facility... The terminal is the original SOUIX. You can launch a program you build in Project Builder basically by invoking its name at the command prompt. From there your familiar printfs and scanfs will work. I said "basically" because it's a little complicated: you can either type the full path to the executable, cd to the program's directory and type ./foo, or add the executable's directory to your PATH environment variable... or, you can skip all of that and use the built-in stdio pane in Project Builder.

(Something like that, anyway...)

Good luck.
     
Luuthan  (op)
Fresh-Faced Recruit
Join Date: Oct 2001
Location: US
Status: Offline
Reply With Quote
Oct 19, 2001, 07:40 AM
 
Thank you aleph_null, you are a great help. I look around at /usr/include and sure enough stdio.h and others are there.

I created an empty project, write a hello world C program and add it to the project, so that's the only file in the project. Configure a target as application, I compiled it and it completed OK. Tried to run it with Terminal but it doesn't work. I don't understand what you said about ./foo and there are many files in the /usr/lib directory, which file(s) should I include with the project.

Anyone can shed a bit more light on how I should go about creating plain C projects in OS X, please let me know. aleph_null, you said something about the built-in stdio pane in Project Builder, where is that and how to use it?
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Oct 19, 2001, 10:41 AM
 
Try the Tool -> Standard Tool template. Project Builder's terminal automatically opens when you press run.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:29 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2