dyld:未加载库:libqscintilla2.5.dylib
我正在尝试在 MacOS X 上使用 QScintilla,我
LIBS += -lqscintilla2
在 .pro 中添加了这个非常简单的代码:(
#include <QApplication>
#include <Qsci/qsciscintilla.h>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QsciScintilla *qscintilla = new QsciScintilla;
qscintilla->show();
return app.exec();
}
我正在使用 QtCreator 顺便说一句)
这是错误:
dyld: Library not loaded: libqscintilla2.5.dylib
Referenced from: /Users/lubethan/cxx-proj/NightPad/NightPad.app/Contents/MacOS/NightPad
Reason: image not found
The program has unexpectedly finished.
I'm trying to use QScintilla on MacOS X, I added
LIBS += -lqscintilla2
in the .pro, with this quite simple code:
#include <QApplication>
#include <Qsci/qsciscintilla.h>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QsciScintilla *qscintilla = new QsciScintilla;
qscintilla->show();
return app.exec();
}
(Im using QtCreator btw)
Here is the error :
dyld: Library not loaded: libqscintilla2.5.dylib
Referenced from: /Users/lubethan/cxx-proj/NightPad/NightPad.app/Contents/MacOS/NightPad
Reason: image not found
The program has unexpectedly finished.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我将 .dylib 复制到 /etc/lib/ 中,它现在可以工作,但我想让该应用程序可分发......
Well I copied the .dylib into /etc/lib/, it works now, but I'd like to make the app distributable...
您需要使用 otool 来查找依赖项。然后您可以使用 install_name_tool 将库的路径更改为相对路径。更多详细信息请参见此处。 http://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac
You need to use otool to find the dependencies. Then you can use install_name_tool to change the path of the library to a relative one. More details here. http://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac