【转】QT怎么调用C++的动态库

2024-12-04 17:18:36
推荐回答(1个)
回答1:

toolc: 准备用QT写一个界面,用界面读取文本数据,具体计算的方法用C++编好的动态库中的函数执行,最后把计算的结果显示在界面上,请问怎么调用?最好有代码或者例子说明。/home/lenovo/qtpro/dll_test-build-desktop/dll_test: error while loading shared libraries: libTax.so.1: cannot open shared object file: No such file or directory qtcreator生成的动态链接库文件和软链接都在/home/lenovo/qtpro/Tax-build-desktop/里面,dll_test的最后unix:!macx:!symbian: LIBS += -L$$PWD/../Tax-build-desktop/ -lTaxINCLUDEPATH += $$PWD/../Tax-build-desktopDEPENDPATH += $$PWD/../Tax-build-desktop之前没有这一段,链接时报错,加上之后就变成上面提到的错误了 ------------------------------------------ XChinux:$export LD_LIBRARY_PATH=/your_shrared_lib_path:$LD_LIBRARY_PATH$/home/lenovo/qtpro/dll_test-build-desktop/dll_test 明白了嘛?