Thread: Header files not found on Mac

  1. #1
    Registered User
    Join Date
    Nov 2013
    Posts
    1

    Header files not found on Mac

    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. #2
    Ultraviolence Connoisseur
    Join Date
    Mar 2004
    Posts
    555
    Have you done a find or something to verify that the files do in fact exist on your system somewhere? If they do exist, then the problem is simply that your compiler/IDE (XCode in this case) is not setup properly to find the files where they are currently residing.

    You should really be asking this question in a MAC or XCode specific forum however, and that is also where you would find the solution to pointing XCode to the current residence of your missing includes.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Such error messages (on any system) are typically a sign of a broken installation (of the compiler, library, etc) or of an incorrectly set environment variable (e.g. one that identifies the include path).
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. visual 2008 with C syntax:header not found
    By 0x0000 in forum C Programming
    Replies: 5
    Last Post: 06-11-2010, 10:13 AM
  2. header files not found
    By abhipro in forum C++ Programming
    Replies: 4
    Last Post: 10-26-2009, 11:39 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  4. Replies: 4
    Last Post: 12-14-2005, 02:21 PM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 02:50 AM

Tags for this Thread