Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gladif

macrumors newbie
Original poster
Nov 2, 2013
1
0
I have a piece of code in C with header files included.
I run it on Mac OS X Maverick with XCode 4.6.2 installed. GCC is also installed. Note that Command Line Tools in XCode are already installed.

When I compile it, the error I receive says something like this:
add.c:1:19: error: stdio.h: No such file or directory
add.c:2:20: error: stdlib.h: No such file or directory
add.c:3:20: error: unistd.h: No such file or directory

However when I run it on Ubuntu, it compiles without a problem.


what to do?
 
Mavericks with XCode in some cases does not setup the correct path to the active developer tools. You can correct this by running the following command at a Terminal prompt:

Code:
xcode-select install

Then try compiling your code using gcc on the command-line.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.