我有一个依赖于几个的 C++ 应用程序.dylib
;其中,libproj
和PythonQt
。
我在单独的目录中预先构建了这些库。
2个(相关)问题:
- 可执行文件找到 的完整路径
libproj.dylib
,尽管它不在路径中,不在 中DYLD_LIBRARY_PATH
,不在 QtCreator 的配置中。如何 ? - 可执行文件找不到 PythonQt,尽管它的链接方式完全相同。我必须手动添加正确的路径
DYLD_LIBRARY_PATH
。为什么 ?
这可能与libproj有a.la
和a.dylib
有关,但PythonQt只有a .dylib
;但我不确定,我不明白这种关系。
otool 的示例输出:
/Users/arnaud/Projects/myprojectname/external/proj-4.8.0/bin_mac64_gcc421_release/lib/libproj.0.dylib (compatibility version 8.0.0, current version 8.0.0)
( so it finds libproj correctly, even in another directory )
libPythonQt.1.dylib (compatibility version 1.0.0, current version 1.0.0)
(... but not libPythonQt, which is in a similar directory )
/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.8.0, current version 4.8.3)
QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.3)
QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.3)
QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.3)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 697.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)