使用QSerialPort在Qt 4.8.1上使用Mac OS X 10.7.5构建Qt问题

时间:2013-10-24 16:52:16

标签: macos qt build

所以我有一个我一直在做的项目。目前我能够在Linux和Windows中构建它而不会有太多麻烦。不过,我在Mac上遇到了一些问题。

我使用的是Mac OS X 10.7.5,Qt 4.8.1。

我为QSerialPort安装了库,因为它们不包含在Qt4中。它看起来像是正确安装的。我的/qt/4.8.1/gcc/lib文件夹现在包括:

libQtSerialPort_debug.1.0.0.dylib
libQtSerialPort_debug.1.0.dylib
libQtSerialPort_debug.1.dylib
libQtSerialPort_debug.dylib
libQtSerialPort_debug.prl

当我尝试构建项目时,这就是我得到的:

Starting /Users/ken/esu_2.x/esu/esu.app/Contents/MacOS/esu...
dyld: Library not loaded: libQtSerialPort_debug.1.dylib
Referenced from: /Users/ken/esu_2.x/esu/esu.app/Contents/MacOS/esu
Reason: image not found
The program has unexpectedly finished.
/Users/ken/esu_2.x/esu/esu.app/Contents/MacOS/esu exited with code 0

编辑:

apples-MacBook-Pro:macOs ken$ otool -L esu
esu:
    libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
    libQtSerialPort_debug.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /Users/ken/QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.1)
    /Users/ken/QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.1)
    /Users/ken/QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.1)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1094.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

1 个答案:

答案 0 :(得分:0)

将QtSerialPort库移至/ usr / lib。它现在有效。