我正试图通过QMake和.pro文件将cpprestsdk与我的Qt小工具应用程序链接起来。我尝试在一个独立的演示应用程序中使用cpprestsdk,CMake文件中有以下部分,工作正常:
find_package(Boost COMPONENTS filesystem system REQUIRED)
find_package(cpprestsdk REQUIRED)
target_link_libraries(demo PRIVATE cpprestsdk::cpprest ssh crypto ${Boost_SYSTEM_LIBRARY})
当试图将其转换为QMake/.pro文件时,如下所示:
INCLUDEPATH += /usr/include/cpprest
INCLUDEPATH += /usr/include/boost
INCLUDEPATH += /usr/include/boost/filesystem
INCLUDEPATH += /usr/include/boost/system
LIBS += -lcrypto -lssl -lboost_system -lboost_filesystem -pthread -lboost_thread -lboost_chrono /usr/local/lib/libcpprest.so
该项目编译良好,但在执行时抛出以下错误:
symbol lookup error: <path> undefined symbol: _ZN7utility7details9str_ilessERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_
C++Filt揭示了未定义的符号为以下函数
c++filt _ZN7utility7details9str_ilessERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_
utility::details::str_iless(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
现在,ldd <application>
向我展示了libcpprest应该正确链接,并且我没有看到任何未链接的依赖项。
libcpprest.so.2.10 => /usr/local/lib/libcpprest.so.2.10
我哪里出错了?
我试用了示例入门教程
带有:
$ sudo apt-get install libcpprest-dev
关于QT创建者在ubuntu 20.04和我添加:
INCLUDEPATH += /usr/include/cpprest
INCLUDEPATH += /usr/include/boost
INCLUDEPATH += /usr/include/boost/filesystem
INCLUDEPATH += /usr/include/boost/system
LIBS += -lcrypto -lssl -lboost_system -lboost_filesystem -pthread -lboost_thread -lboost_chrono /usr/local/lib/libcpprest.so
从你以前的帖子到.pro文件
它建立了持久的