简体   繁体   中英

Mac + xcode 6.4 - header include path

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

Eg: 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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM