使用' make'时未定义的参考错误构建一个共享的.so库

时间:2016-10-20 15:53:59

标签: c++ shared-libraries .so

我是Linux的新手,并且主要使用像Visual Studio这样的IDE来使用C ++。我在Ubuntu 16.04上尝试使用.so共享库构建一些代码,但是我收到了这个错误,我不明白它是什么错误。

[ 50%] Building CXX object CMakeFiles/akelae2e.dir/akelae2etest.cpp.o
[100%] Linking CXX executable akelae2e
/usr/bin/ld: warning: libicuuc.so.52, needed by libndsdm.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicui18n.so.52, needed by libndsdm.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libleveldb.so.1, needed by libndsdm.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
libndsdm.so: undefined reference to `leveldb::WritableFile::~WritableFile()'
libndsdm.so: undefined reference to `curl_easy_reset@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `ucol_open_52'
libndsdm.so: undefined reference to `curl_multi_add_handle@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_easy_cleanup@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `uregex_open_52'
libndsdm.so: undefined reference to `ubrk_current_52'
libndsdm.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
libndsdm.so: undefined reference to `leveldb::WriteBatch::~WriteBatch()'
libndsdm.so: undefined reference to `leveldb::DestroyDB(std::string const&, leveldb::Options const&)'
libndsdm.so: undefined reference to `curl_multi_strerror@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `ubrk_open_52'
libndsdm.so: undefined reference to `curl_slist_free_all@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `u_errorName_52'
libndsdm.so: undefined reference to `ucol_strcoll_52'
libndsdm.so: undefined reference to `leveldb::Logger::~Logger()'
libndsdm.so: undefined reference to `curl_multi_fdset@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `leveldb::WriteBatch::WriteBatch()'
libndsdm.so: undefined reference to `leveldb::Options::Options()'
libndsdm.so: undefined reference to `utf8_nextCharSafeBody_52'
libndsdm.so: undefined reference to `leveldb::Status::ToString() const'
libndsdm.so: undefined reference to `u_strToUpper_52'
libndsdm.so: undefined reference to `curl_easy_setopt@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_multi_init@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `ubrk_close_52'
libndsdm.so: undefined reference to `leveldb::RepairDB(std::string const&, leveldb::Options const&)'
libndsdm.so: undefined reference to `curl_multi_remove_handle@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `typeinfo for leveldb::Logger'
libndsdm.so: undefined reference to `ubrk_first_52'
libndsdm.so: undefined reference to `u_foldCase_52'
libndsdm.so: undefined reference to `uregex_close_52'
libndsdm.so: undefined reference to `curl_easy_strerror@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `typeinfo for leveldb::WritableFile'
libndsdm.so: undefined reference to `leveldb::Env::~Env()'
libndsdm.so: undefined reference to `leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
libndsdm.so: undefined reference to `leveldb::Status::CopyState(char const*)'
libndsdm.so: undefined reference to `leveldb::Env::Default()'
libndsdm.so: undefined reference to `u_strToUTF8_52'
libndsdm.so: undefined reference to `curl_easy_init@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `u_strToLower_52'
libndsdm.so: undefined reference to `curl_easy_getinfo@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_multi_cleanup@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_multi_timeout@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `u_isspace_52'
libndsdm.so: undefined reference to `uregex_matches_52'
libndsdm.so: undefined reference to `curl_multi_perform@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_slist_append@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `curl_multi_info_read@CURL_OPENSSL_3'
libndsdm.so: undefined reference to `leveldb::WriteBatch::Delete(leveldb::Slice const&)'
libndsdm.so: undefined reference to `ubrk_next_52'
libndsdm.so: undefined reference to `uregex_setText_52'
libndsdm.so: undefined reference to `typeinfo for leveldb::Env'
libndsdm.so: undefined reference to `ucol_close_52'
collect2: error: ld returned 1 exit status
CMakeFiles/akelae2e.dir/build.make:95: recipe for target 'akelae2e' failed
make[2]: *** [akelae2e] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/akelae2e.dir/all' failed
make[1]: *** [CMakeFiles/akelae2e.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

0 个答案:

没有答案