在 Xcode 中为 C++ 设置动态库路径和许可证信息代码
我是 Xcode 新用户(版本 3.2.2;Mac 10.6.7)。
我编写了需要与商业代码结合使用的C++代码。我可以在终端窗口中运行代码,但不能在 Xcode 中运行(错误如下所述)。商业代码使用许可证,并且还具有动态库。我的问题可能与这些问题有关。商业代码编写者对 Xcode 并不熟悉。
当我在 Xcode 中运行代码时,出现以下错误:
dyld: Library not loaded:
Referenced from: /Users/me/Desktop/executableName
Reason: image not found
Trace/BPT trap
logout
要在终端窗口(不是 Xcode)中成功运行代码,我首先执行以下操作: 1) 导出 LD_LIBRARY_PATH=.:$DYLD_LIBRARY_PATH 2) 导出 [email protected]
在 Xcode 中,我认为应该设置为: 项目菜单-->编辑活动可执行文件 -->要在环境中设置的变量为:
名称:LM_LICENSE_FILE;值:[电子邮件受保护] 名称:DYLD_LIBRARY_PATH;值:/Applications/myCode/libraries/xxx
但是当我这样做时,我收到上面的错误。
另一条信息是,我的代码位于 代码: /应用 。但我的 Xcode 项目保存在 代码: /用户/我/桌面/可执行文件名称 。错误消息确实说“引用自”桌面。这是否表明有问题?什么?
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 not 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 [email protected]
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: [email protected] 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论