dyld: Library not loaded: libqscintilla2.5.dylib

别说谁变了你拦得住时间么 提交于 2019-12-24 11:23:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!