问题
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.
回答1:
Well I copied the .dylib into /etc/lib/, it works now, but I'd like to make the app distributable...
回答2:
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
来源:https://stackoverflow.com/questions/4082503/dyld-library-not-loaded-libqscintilla2-5-dylib