Setting dynamic library path and license info in Xcode for C++ code
I am a new Xcode user (version 3.2.2; Mac 10.6.7).
I have written C++ code that needs to be used in combination with commercial code. I can run the code in a terminal window, but no开发者_如何学运维t in Xcode (error described below). The commercial code uses a license and it also has dynamic libraries. My problem is probably related to these issues. The commercial code writers are not familiar with Xcode.
When I run the code in Xcode, this is the error:
dyld: Library not loaded:
Referenced from: /Users/me/Desktop/executableName
Reason: image not found
Trace/BPT trap
logout
To run the code successfully in a Terminal window (not Xcode), I first do: 1) export LD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH 2) export LM_LICENSE_FILE=1234@lic-xxx.xxx.xx
In Xcode, I think that this should be set in: Project menu --> Edit Active Executable --> Variables to be set in the environment as:
Name: LM_LICENSE_FILE; Value: 1234@lic-xxx.xxx.xx Name: DYLD_LIBRARY_PATH; Value: /Applications/myCode/libraries/xxx
But when I do this, I get the error above.
One further piece of information is, my code is in Code: /Applications . But my Xcode project is saved at Code: /Users/me/Desktop/executableName . The error message DOES say "referenced from" the desktop. Could this indicate a problem? What?
精彩评论