柯南构建的 C++ 程序突然无法链接
conan built C++ program suddenly not linking
我正在用 C++ 编写一个项目并利用 conan + cmake 来管理依赖项。我刚刚开始寻求升级到最新版本的客户端和节俭依赖项(v0.13 到 v0.15),但是它在链接阶段突然抱怨...
尝试添加 thriftnb
、CONAN_PKG::thriftnb
、event
...但似乎没有任何改变
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library thriftz found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthriftz.a
-- Library thriftnb found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthriftnb.a
-- Library thrift found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthrift.a
-- Library twsapi found /home/emcp/.conan/data/ibsapi/10.10.01/bonks/prod/package/2a30b7d6ea2202e5393ebda51c8729dd2162b9f8/lib/libtwsapi.a
-- Library boost_contract found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_contract.a
-- Library boost_coroutine found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_coroutine.a
-- Library boost_fiber_numa found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_fiber_numa.a
-- Library boost_fiber found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_fiber.a
-- Library boost_context found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_context.a
-- Library boost_graph found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_graph.a
-- Library boost_iostreams found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_iostreams.a
-- Library boost_json found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_json.a
-- Library boost_locale found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_locale.a
-- Library boost_log_setup found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_log_setup.a
-- Library boost_log found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_log.a
-- Library boost_math_c99 found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99.a
-- Library boost_math_c99f found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99f.a
-- Library boost_math_c99l found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99l.a
-- Library boost_math_tr1 found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1.a
-- Library boost_math_tr1f found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1f.a
-- Library boost_math_tr1l found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1l.a
-- Library boost_nowide found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_nowide.a
-- Library boost_program_options found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_program_options.a
-- Library boost_random found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_random.a
-- Library boost_regex found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_regex.a
-- Library boost_stacktrace_addr2line found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_addr2line.a
-- Library boost_stacktrace_backtrace found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_backtrace.a
-- Library boost_stacktrace_basic found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_basic.a
-- Library boost_stacktrace_noop found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_noop.a
-- Library boost_timer found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_timer.a
-- Library boost_type_erasure found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_type_erasure.a
-- Library boost_thread found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_thread.a
-- Library boost_chrono found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_chrono.a
-- Library boost_container found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_container.a
-- Library boost_date_time found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_date_time.a
-- Library boost_unit_test_framework found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_unit_test_framework.a
-- Library boost_prg_exec_monitor found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_prg_exec_monitor.a
-- Library boost_test_exec_monitor found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_test_exec_monitor.a
-- Library boost_exception found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_exception.a
-- Library boost_wave found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_wave.a
-- Library boost_filesystem found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_filesystem.a
-- Library boost_atomic found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_atomic.a
-- Library boost_wserialization found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_wserialization.a
-- Library boost_serialization found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_serialization.a
-- Library event_extra found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_extra.a
-- Library event_openssl found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_openssl.a
-- Library event_pthreads found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_pthreads.a
-- Library event_core found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_core.a
-- Library z found /home/emcp/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libz.a
-- Library bz2 found /home/emcp/.conan/data/bzip2/1.0.8/_/_/package/da606cf731e334010b0bf6e85a2a6f891b9f36b0/lib/libbz2.a
-- Library backtrace found /home/emcp/.conan/data/libbacktrace/cci.20210118/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libbacktrace.a
-- Library ssl found /home/emcp/.conan/data/openssl/1.1.1m/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libssl.a
-- Library crypto found /home/emcp/.conan/data/openssl/1.1.1m/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libcrypto.a
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /ibs-api-thrift/servers/cpp_server/build_cmake
-- Conan: Compiler GCC>=5, checking major version 9
-- Conan: Checking correct version: 9
-- Configuring done
-- Generating done
-- Build files have been written to: /ibsapi-thrift/servers/cpp_server/build_cmake
...
[100%] Linking CXX executable bin/jokers_server
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_connect(int)':
jokers.cpp:(.text+0x63f8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6416): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_disconnect(int)':
jokers.cpp:(.text+0x6968): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6986): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_ping(int)':
jokers.cpp:(.text+0x6ed8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6ef6): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_ib_status(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, int)':
jokers.cpp:(.text+0xa098): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xa0b6): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_news(std::vector<ibsapithrift::NewsResponse, std::allocator<ibsapithrift::NewsResponse> >&, int)':
jokers.cpp:(.text+0xd378): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xd396): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_historical(std::vector<ibsapithrift::HistoricalResponse, std::allocator<ibsapithrift::HistoricalResponse> >&, int)':
jokers.cpp:(.text+0xe4f8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xe516): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_matching_symbols(std::vector<ibsapithrift::MatchingSymbolResponse, std::allocator<ibsapithrift::MatchingSymbolResponse> >&, int)':
jokers.cpp:(.text+0xf678): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xf696): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/jokers_server.dir/build.make:212: bin/jokers_server] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/jokers_server.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
chmod: cannot access 'jokers_server': No such file or directory
我的CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
project(jokers_server)
add_compile_options(-std=c++17)
# Using the "cmake" generator
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
FILE ( GLOB THRIFT_GEN_SRC src/gen-cpp/*.cpp )
FILE ( GLOB IBS_API_SRC src/ibs-client/*.cpp )
add_executable(jokers_server src/jokers_server.cpp src/threadsafe_stack.cpp ${THRIFT_GEN_SRC} ${IBS_API_SRC} )
target_link_libraries(jokers_server pthread CONAN_PKG::thrift CONAN_PKG::ibsapi)`
我做了一些挖掘,我可能需要添加 lib 事件..柯南在依赖项中找到了它但是..添加 CONAN_PKG::libevent
什么也没做
编辑:在节俭文档中
https://github.com/apache/thrift/tree/master/lib/cpp#linking-against-thrift-1
You need to link your project that uses thrift against all the thrift
dependencies; in the case of libthrift, openssl, pthreads, and librt
and for libthriftnb, libevent.
In the project properties you must also set HAVE_CONFIG_H as force
include the config header: "windows/config.h"
如果我需要添加一些东西,有什么线索吗?这一切在我上次构建项目时都是有效的..所以我一定是错过了我以前的机器在本地拥有的一些开发工具?
原来.. 默认情况下柯南不执行新的 ABI.. 所以当我最后构建它时,我不得不设置默认行为.. 你可以通过以下命令来做到这一点..一旦我这样做并重建了我的 ibs-api
柯南食谱.. 并构建了 thrift
.. 一切正常 100%
conan profile update settings.compiler.libcxx=libstdc++11 <MY_DEFAULT_PROFILE>
我正在用 C++ 编写一个项目并利用 conan + cmake 来管理依赖项。我刚刚开始寻求升级到最新版本的客户端和节俭依赖项(v0.13 到 v0.15),但是它在链接阶段突然抱怨...
尝试添加 thriftnb
、CONAN_PKG::thriftnb
、event
...但似乎没有任何改变
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library thriftz found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthriftz.a
-- Library thriftnb found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthriftnb.a
-- Library thrift found /home/emcp/.conan/data/thrift/0.13.0/_/_/package/44b3a17b9712eb98c7cab65c26ec70335992ff20/lib/libthrift.a
-- Library twsapi found /home/emcp/.conan/data/ibsapi/10.10.01/bonks/prod/package/2a30b7d6ea2202e5393ebda51c8729dd2162b9f8/lib/libtwsapi.a
-- Library boost_contract found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_contract.a
-- Library boost_coroutine found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_coroutine.a
-- Library boost_fiber_numa found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_fiber_numa.a
-- Library boost_fiber found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_fiber.a
-- Library boost_context found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_context.a
-- Library boost_graph found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_graph.a
-- Library boost_iostreams found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_iostreams.a
-- Library boost_json found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_json.a
-- Library boost_locale found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_locale.a
-- Library boost_log_setup found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_log_setup.a
-- Library boost_log found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_log.a
-- Library boost_math_c99 found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99.a
-- Library boost_math_c99f found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99f.a
-- Library boost_math_c99l found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_c99l.a
-- Library boost_math_tr1 found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1.a
-- Library boost_math_tr1f found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1f.a
-- Library boost_math_tr1l found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_math_tr1l.a
-- Library boost_nowide found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_nowide.a
-- Library boost_program_options found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_program_options.a
-- Library boost_random found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_random.a
-- Library boost_regex found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_regex.a
-- Library boost_stacktrace_addr2line found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_addr2line.a
-- Library boost_stacktrace_backtrace found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_backtrace.a
-- Library boost_stacktrace_basic found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_basic.a
-- Library boost_stacktrace_noop found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_stacktrace_noop.a
-- Library boost_timer found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_timer.a
-- Library boost_type_erasure found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_type_erasure.a
-- Library boost_thread found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_thread.a
-- Library boost_chrono found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_chrono.a
-- Library boost_container found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_container.a
-- Library boost_date_time found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_date_time.a
-- Library boost_unit_test_framework found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_unit_test_framework.a
-- Library boost_prg_exec_monitor found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_prg_exec_monitor.a
-- Library boost_test_exec_monitor found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_test_exec_monitor.a
-- Library boost_exception found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_exception.a
-- Library boost_wave found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_wave.a
-- Library boost_filesystem found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_filesystem.a
-- Library boost_atomic found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_atomic.a
-- Library boost_wserialization found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_wserialization.a
-- Library boost_serialization found /home/emcp/.conan/data/boost/1.78.0/_/_/package/adf48b8e4446dcb68f440fe42ff08878d5c7feed/lib/libboost_serialization.a
-- Library event_extra found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_extra.a
-- Library event_openssl found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_openssl.a
-- Library event_pthreads found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_pthreads.a
-- Library event_core found /home/emcp/.conan/data/libevent/2.1.12/_/_/package/6b0981c427aa0eb8bea05add2094df29ed639799/lib/libevent_core.a
-- Library z found /home/emcp/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libz.a
-- Library bz2 found /home/emcp/.conan/data/bzip2/1.0.8/_/_/package/da606cf731e334010b0bf6e85a2a6f891b9f36b0/lib/libbz2.a
-- Library backtrace found /home/emcp/.conan/data/libbacktrace/cci.20210118/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libbacktrace.a
-- Library ssl found /home/emcp/.conan/data/openssl/1.1.1m/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libssl.a
-- Library crypto found /home/emcp/.conan/data/openssl/1.1.1m/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib/libcrypto.a
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /ibs-api-thrift/servers/cpp_server/build_cmake
-- Conan: Compiler GCC>=5, checking major version 9
-- Conan: Checking correct version: 9
-- Configuring done
-- Generating done
-- Build files have been written to: /ibsapi-thrift/servers/cpp_server/build_cmake
...
[100%] Linking CXX executable bin/jokers_server
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_connect(int)':
jokers.cpp:(.text+0x63f8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6416): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_disconnect(int)':
jokers.cpp:(.text+0x6968): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6986): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_ping(int)':
jokers.cpp:(.text+0x6ed8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0x6ef6): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_ib_status(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, int)':
jokers.cpp:(.text+0xa098): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xa0b6): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_news(std::vector<ibsapithrift::NewsResponse, std::allocator<ibsapithrift::NewsResponse> >&, int)':
jokers.cpp:(.text+0xd378): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xd396): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_historical(std::vector<ibsapithrift::HistoricalResponse, std::allocator<ibsapithrift::HistoricalResponse> >&, int)':
jokers.cpp:(.text+0xe4f8): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xe516): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
/usr/bin/ld: CMakeFiles/jokers_server.dir/src/gen-cpp/jokers.cpp.o: in function `ibsapithrift::jokersConcurrentClient::recv_request_matching_symbols(std::vector<ibsapithrift::MatchingSymbolResponse, std::allocator<ibsapithrift::MatchingSymbolResponse> >&, int)':
jokers.cpp:(.text+0xf678): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)'
/usr/bin/ld: jokers.cpp:(.text+0xf696): undefined reference to `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, apache::thrift::protocol::TMessageType&, int&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/jokers_server.dir/build.make:212: bin/jokers_server] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/jokers_server.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
chmod: cannot access 'jokers_server': No such file or directory
我的CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
project(jokers_server)
add_compile_options(-std=c++17)
# Using the "cmake" generator
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
FILE ( GLOB THRIFT_GEN_SRC src/gen-cpp/*.cpp )
FILE ( GLOB IBS_API_SRC src/ibs-client/*.cpp )
add_executable(jokers_server src/jokers_server.cpp src/threadsafe_stack.cpp ${THRIFT_GEN_SRC} ${IBS_API_SRC} )
target_link_libraries(jokers_server pthread CONAN_PKG::thrift CONAN_PKG::ibsapi)`
我做了一些挖掘,我可能需要添加 lib 事件..柯南在依赖项中找到了它但是..添加 CONAN_PKG::libevent
什么也没做
编辑:在节俭文档中 https://github.com/apache/thrift/tree/master/lib/cpp#linking-against-thrift-1
You need to link your project that uses thrift against all the thrift dependencies; in the case of libthrift, openssl, pthreads, and librt and for libthriftnb, libevent.
In the project properties you must also set HAVE_CONFIG_H as force include the config header: "windows/config.h"
如果我需要添加一些东西,有什么线索吗?这一切在我上次构建项目时都是有效的..所以我一定是错过了我以前的机器在本地拥有的一些开发工具?
原来.. 默认情况下柯南不执行新的 ABI.. 所以当我最后构建它时,我不得不设置默认行为.. 你可以通过以下命令来做到这一点..一旦我这样做并重建了我的 ibs-api
柯南食谱.. 并构建了 thrift
.. 一切正常 100%
conan profile update settings.compiler.libcxx=libstdc++11 <MY_DEFAULT_PROFILE>