Header files not found on Mac

Discussion in 'Mac Programming' started by gladif, Nov 2, 2013.

  1. gladif macrumors newbie

    Joined:
    Nov 2, 2013
    #1
    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?
     
  2. mrichmon macrumors 6502a

    Joined:
    Jun 17, 2003
    #3
    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.
     

Share This Page