Qt program does not detect libraries

旧巷老猫 提交于 2019-12-05 22:02:38
hank

On Linux current binary directiry is not the place where the loader looks for shared libraries. See this question: https://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable

You can add the following to your .pro file to force the dynamic linker to look in the same directory as your Qt application at runtime in Linux :

unix:{
    # suppress the default RPATH if you wish
    QMAKE_LFLAGS_RPATH=
    # add your own with quoting gyrations to make sure $ORIGIN gets to the command line unexpanded
    QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!