参照以下的方法,上面的问题已解决。
%otool -L libDobotDll.1.0.0.dylib
libDobotDll.1.0.0.dylib:
libDobotDll.1.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.7.0, current version 5.7.0)
@executable_path/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
@executable_path/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
@executable_path/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@executable_path/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.7.0, current version 5.7.0)
@executable_path/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
@executable_path/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
executable_path的部分,全部用install_name_tool的工具来修改路径。例如:
install_name_tool -change @executable_path/QtSerialPort.framework/Versions/5/QtSerialPort /Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/QtSerialPort.framework/Versions/5/QtSerialPort libDobotDll.1.0.0.dylib
修改之后:
%otool -L libDobotDll.1.0.0.dylib
libDobotDll.1.0.0.dylib:
libDobotDll.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.7.0, current version 5.7.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.7.0, current version 5.7.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
%python DobotControl.py
CDobotConnector : QThread(0x7fc9b9e19ca0)
CDobotProtocol : QThread(0x7fc9b9f022a0)
CDobotCommunicator : QThread(0x7fc9b9c96fa0)
Connect status: Success
结论:
precompiled目录下的dll文件,编译的估计有问题。没法在Macbook的command line中执行。