Question

I have a problem using libclang:

I built libclang locally. It resides somewhere like clang-llvm/…/libclang.3.4.dylib.

Then I developed a foundation tool using that dylib. (exactly: I copied a version to my project folder and linked against this.) The foundation tool works fine. But, of course, at load time it uses the dylib in my local build folder. This is unacceptable, because the user of the tool has to install clang to use my tool.

So I copied libclang.3.4.dylib to a location inside /usr/…/libclang.3.4.dylib and changed the installation path to that location using install_name_path -id /usr/…/libclang.3.4.dylib /usr/…/libclang.3.4.dylib.

After that my tool finds the dylib there but does not work since the parser cannot find stdarg.h any more in the file, that is parsed by my tool.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:12:10: fatal error: 'stdarg.h' file not found

How can I set the installation path of libclang.3.4.dylib to something public?

Was it helpful?

Solution

Amin, my good friend.

<sarcasm>

From what you wrote it should be OBVIOUS to EVERYONE that you have to create a release build of your tool and NOT a debug build. Xcode should have told you that in the form of CLEAR and EASY to understand error messages.

</sarcasm>

Solution: Use a release build of your tool instead of a debug build.

:)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top