nebula-cpp-client版本:3.0.0
最近在尝试将nebula-cpp-client引入clickhouse,编译链接时遇到问题,请教如何将nebula-cpp-client编译成静态库而非动态库,是否可以解决该问题。
编译命令
/usr/bin/clang++ -fdiagnostics-color=always -std=c++2a -fsized-deallocation -gdwarf-aranges -pipe -msse4.1 -msse4.2 -mpopcnt -Wall -Wno-unused-command-line-argument -fdiagnostics-absolute-paths -fexperimental-new-pass-manager -Werror -Wextra -Wframe-larger-than=32768 -Wpedantic -Wno-vla-extension -Wno-zero-length-array -Wno-c11-extensions -Wcomma -Wconditional-uninitialized -Wcovered-switch-default -Wdeprecated -Wembedded-directive -Wempty-init-stmt -Wextra-semi-stmt -Wextra-semi -Wgnu-case-range -Winconsistent-missing-destructor-override -Wnewline-eof -Wold-style-cast -Wrange-loop-analysis -Wredundant-parens -Wreserved-id-macro -Wshadow-field -Wshadow-uncaptured-local -Wshadow -Wstring-plus-int -Wundef -Wunreachable-code-return -Wunreachable-code -Wunused-exception-parameter -Wunused-macros -Wunused-member-function -Wzero-as-null-pointer-constant -Weverything -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-c99-extensions -Wno-conversion -Wno-ctad-maybe-unsupported -Wno-deprecated-dynamic-exception-spec -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors -Wno-float-equal -Wno-global-constructors -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-nested-anon-types -Wno-packed -Wno-padded -Wno-return-std-move-in-c++11 -Wno-shift-sign-overflow -Wno-sign-conversion -Wno-switch-enum -Wno-undefined-func-template -Wno-unused-template -Wno-vla -Wno-weak-template-vtables -Wno-weak-vtables -O2 -g -DNDEBUG -O3 -fno-pie -fuse-ld=/usr/bin/ld.lld-10 -Wl,--no-undefined -static-libstdc++ -rdynamic src/CMakeFiles/clickhouse_malloc.dir/Common/malloc.cpp.o base/nebula/tests/CMakeFiles/storage_client_example.dir/StorageClientExample.cpp.o -o base/nebula/tests/storage_client_example -L/usr/local/nebula/lib64 -L/usr/local/nebula/lib -Wl,-rpath,/usr/local/nebula/lib64:/usr/local/nebula/lib src/libclickhouse_new_delete.a -lnebula_storage_client src/libclickhouse_common_io.a src/Common/StringUtils/libstring_utils.a base/widechar_width/libwidechar_width.a base/common/libcommon.a contrib/FastMemcpy/libFastMemcpy.a contrib/poco-cmake/Net/SSL/lib_poco_net_ssl.a contrib/poco-cmake/Net/lib_poco_net.a contrib/poco-cmake/Crypto/lib_poco_crypto.a contrib/poco-cmake/Util/lib_poco_util.a contrib/poco-cmake/JSON/lib_poco_json.a contrib/poco-cmake/JSON/lib_poco_json_pdjson.a contrib/poco-cmake/XML/lib_poco_xml.a contrib/poco-cmake/XML/lib_poco_xml_expat.a contrib/replxx-cmake/libreplxx.a contrib/cctz-cmake/libcctz.a -Wl,--whole-archive /home/starrysky/projects/clickhouse-v20.11.4.13-stable/ClickHouse/build/contrib/cctz-cmake/libtzdata.a -Wl,--no-whole-archive contrib/fmtlib-cmake/libfmt.a contrib/double-conversion-cmake/libdouble-conversion.a contrib/ryu-cmake/libryu.a contrib/re2/libre2.a contrib/re2_st/libre2_st.a contrib/libcpuid-cmake/libcpuid.a contrib/boost-cmake/lib_boost_program_options.a contrib/boost-cmake/lib_boost_system.a contrib/cityhash102/libcityhash.a contrib/poco-cmake/Foundation/lib_poco_foundation.a contrib/poco-cmake/Foundation/lib_poco_foundation_pcre.a contrib/croaring-cmake/libroaring.a contrib/libhdfs3-cmake/libhdfs3.a contrib/libgsasl/liblibgsasl.a contrib/libxml2-cmake/liblibxml2.a contrib/zlib-ng/libzlib.a contrib/protobuf/libprotobuf.a -pthread contrib/aws-s3-cmake/libaws_s3.a contrib/openssl-cmake/libssl.a contrib/openssl-cmake/libcrypto.a contrib/aws-s3-cmake/libaws_s3_checksums.a contrib/brotli-cmake/libbrotli.a contrib/jemalloc-cmake/libjemalloc.a -Wl,--start-group base/glibc-compatibility/libglibc-compatibility.a contrib/libcxx-cmake/libcxx.a contrib/libcxxabi-cmake/libcxxabi.a contrib/libunwind-cmake/libunwind.a -Wl,--end-group -nodefaultlibs /usr/lib/llvm-10/lib/clang/10.0.0/lib/linux/libclang_rt.builtins-x86_64.a -lc -lm -lrt -lpthread -ldl
报错信息
ld.lld-10: error: undefined symbol: nebula::StorageClient::StorageClient(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, nebula::MConfig const&, nebula::SConfig const&)
>>> referenced by StorageClientExample.cpp:23 (../base/nebula/tests/StorageClientExample.cpp:23)
>>> base/nebula/tests/CMakeFiles/storage_client_example.dir/StorageClientExample.cpp.o:(main)
ld.lld-10: error: undefined symbol: nebula::StorageClient::getParts(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by StorageClientExample.cpp:25 (../base/nebula/tests/StorageClientExample.cpp:25)
>>> base/nebula/tests/CMakeFiles/storage_client_example.dir/StorageClientExample.cpp.o:(main)