2013-10-24 49 views
1

因此,我有一個我一直在研究的項目。目前,我可以在Linux和Windows上構建它,而不會有太多麻煩。但是,我在Mac上遇到了一些問題。使用QSerialPort以Qt 4.8.1構建於Mac OS X 10.7.5上的Qt問題

我使用的是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) 

回答

0

將QtSerialPort庫移至/ usr/lib。它現在有效。