Reputation: 19
So, I have an Xcode project that contains sources which include headers from external library (static one)
The include is done in common way:
#include <iostream>
#include <string>
#include <jsapi.h>
The third line causes compiler error: 'jsapi.h' file not found
E.g.: Lexical or Preprocessor issue 'jsapi.h' file not found
Now I got that I should add include folder into the project settings. So I opened the projects and into Search Paths
category under Header Search Paths
I've added /usr/local/include/
where the headers really are. Still same error. I tried copying them under /Users/.../include/
and pointing there - still same error.
So I tried going through SO and people suggested using User Header Search Paths
, did that - still same error.
Now I know this will be something really dumb, but why Xcode does not search those paths on default (assuming that /
means root folder - as for some reason my C headers are under ./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/
). I could try copying those header files in there, but well ... that just makes more harm than good.
Upvotes: 1
Views: 7315
Reputation: 405
Just to show....
The "build tab" is called "Report Navigator". I circled it...
Then you can see the icon to the far right of:
Click that button and you will see the text of the build command in its full glory.
Finally, in the option, you can see below that I have the setting defined for a 3rd party library:
You can even see that I used the "User Header Search Paths" in this case. BTW, I also added the library search path (just above).
Hope that helps!
Upvotes: 1