using includes with include path

Discussion in 'Mac Programming' started by eddyq, Aug 10, 2009.

  1. eddyq macrumors member

    Jun 10, 2009
    The compiler does not find config/config.h

    I have an include like this:
    #include <config/config.h>
    My project is at the same level as the "config" folder.
    In Project->Edit Active Target "xxx" I entered the search paths under Search Paths->Header Search Paths as ".". I also tried "./" and I also tried just eliminting the path.
    I have verified that config/config.h is available.
    It does not find config.h.
    I then copied config.h into the level above (same level as the project) and the compiler finds it for all cases of ".", "./" and nothing.

    So my question is ... with an include as above, what is the correct procedure to get the compiler to find the given .h file? (note that on other systems such as NetBSD and Linux the include directive is the correct format).
  2. eddyq thread starter macrumors member

    Jun 10, 2009
    Never mind ... I didn't realize that when I made the project it made a new folder for the xcodeproj file. So instead of "." I have to use "..".
  3. eddyq thread starter macrumors member

    Jun 10, 2009
    Well I spoke too soon. Using .. does not work. Does anyone know how to specify the above mentioned include path?
  4. SRossi macrumors regular

    May 27, 2009
    Glasgow, Scotland
    Is it a framework or is it just a normal header file.

    If it is just a header file have u self created it or is it a system created header?

  5. eddyq thread starter macrumors member

    Jun 10, 2009
    The headers are my own headers.


    Throughout the source, header files are included like "#include <foo/foo.h>", "#include <baz/baz.h>"

    I have added ".." to the Project->Edit Active Target "name"->Search Paths->Header Search Paths. I also tried using /Users/eddyq/Desktop/top_level. I also tried ".".

    I just can't get the compiler to find the the .h files.
  6. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    When you enclose the header name in < >, it means a system include. For user includes, i.e. ones you provide, you should be using "foo/foo.h", and you should specify a user-include path that contains the "foo" folder where "foo.h" can be found.

Share This Page