在 Mac OS X 上使用 Qwt
如何使用 Qwt 在 Mac OS X 上?
我总是收到一条错误消息,告诉我找不到 libqwt.dylib
。根据我从谷歌搜索中了解到的情况,在 environment.plist
中设置 DYLD_LIBRARY_PATH
没有帮助,因为苹果出于安全原因已禁用它,所以我该怎么办它(无需在每次重新编译时手动将库复制到我的 .app 中)?
我已经尝试了 qmake -spec macx-g++
和 qmake
,没有任何规范。该库目前位于 /usr/local/qwt/lib
中。我应该手动将其移动到某个系统路径还是有更好的方法(通过使用 otool 和 install_name_tool 魔法)?
How can I compile and run Qt programs using Qwt on Mac OS X?
I always get an error telling me that it can't find libqwt.dylib
. For what I have understood from my googling it won't help to set DYLD_LIBRARY_PATH
in environment.plist
since Apple has disabled that due to security reasons so how am I supposed to do it (without manually copying the lib to my .app for every recompile)?
I have tried both qmake -spec macx-g++
and qmake
without any spec. The lib is in /usr/local/qwt/lib
at the moment. Should I move it to some system path manually or is there a better way to do it (by using otool and install_name_tool magics)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为编辑environment.plist或以任何其他方式更改您的配置文件设置以添加此类“非标准”路径是个坏主意。
我假设您的项目 *.pro 文件中有类似的内容:
或者您尝试运行其中包含所有这些附加路径的示例之一:
无论如何,您在程序启动时收到此消息:
好吧,您可以使用解决方案来自此博客文章。我已经用 Qt 4.6 和 Qwt 5.2 对其进行了测试。有用。
在 qwt 源代码分发目录中运行 qmake -spec macx-g++ 后(您已完成),编辑 src/Makefile。找到字符串
并使其看起来像这样(更改为完整路径)
现在(重新)构建 Qwt(make clean && make)并重新安装它(sudo make install)。
I think it's bad idea to edit environment.plist or in any other way to change your profile settings to add such "non-standard" path to it.
I assumed you have something like this in you project *.pro file:
Or you try to run one of samples where all this additional path are included by:
Anyway you get this message at program start:
Well, you can use solution from this blog post. I have tested it with Qt 4.6 and Qwt 5.2. It works.
After running
qmake -spec macx-g++
in qwt sources distribution directory (already done by you), edit src/Makefile. Find the string withand make it looks like this (change to full path)
Now (re)build Qwt (make clean && make) and reinstall it (sudo make install).