添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encfs uses easylogging++ v9.94.1. Building encfs with GCC results in warnings about undefined reference to ``el::base::elStorage' vgough/encfs#291
Unfortunately, some distribution like Leap configure GCC to produce an error instead of a warning for undefined references.
Can the undefined reference problem be fixed?

Here is a sample of the build log.

[  169s] /usr/bin/cmake -E cmake_link_script CMakeFiles/encfs.dir/link.txt --verbose=1
[  169s] /usr/bin/c++  -fPIC -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -O2 -g -DNDEBUG -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libencfs.so.1.9 -o libencfs.so.1.9.1 CMakeFiles/encfs.dir/internal/easylogging++.cc.o CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o CMakeFiles/encfs.dir/encfs/base64.cpp.o CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o CMakeFiles/encfs.dir/encfs/Cipher.cpp.o CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o CMakeFiles/encfs.dir/encfs/CipherKey.cpp.o CMakeFiles/encfs.dir/encfs/ConfigReader.cpp.o CMakeFiles/encfs.dir/encfs/ConfigVar.cpp.o CMakeFiles/encfs.dir/encfs/Context.cpp.o CMakeFiles/encfs.dir/encfs/DirNode.cpp.o CMakeFiles/encfs.dir/encfs/encfs.cpp.o CMakeFiles/encfs.dir/encfs/Error.cpp.o CMakeFiles/encfs.dir/encfs/FileIO.cpp.o CMakeFiles/encfs.dir/encfs/FileNode.cpp.o CMakeFiles/encfs.dir/encfs/FileUtils.cpp.o CMakeFiles/encfs.dir/encfs/Interface.cpp.o CMakeFiles/encfs.dir/encfs/MACFileIO.cpp.o CMakeFiles/encfs.dir/encfs/MemoryPool.cpp.o CMakeFiles/encfs.dir/encfs/NameIO.cpp.o CMakeFiles/encfs.dir/encfs/NullCipher.cpp.o CMakeFiles/encfs.dir/encfs/NullNameIO.cpp.o CMakeFiles/encfs.dir/encfs/openssl.cpp.o CMakeFiles/encfs.dir/encfs/RawFileIO.cpp.o CMakeFiles/encfs.dir/encfs/readpassphrase.cpp.o CMakeFiles/encfs.dir/encfs/SSL_Cipher.cpp.o CMakeFiles/encfs.dir/encfs/StreamNameIO.cpp.o CMakeFiles/encfs.dir/encfs/XmlReader.cpp.o  -L/home/abuild/rpmbuild/BUILD/encfs-1.9.1/build/internal/tinyxml2-3.0.0 -lfuse -lssl -lcrypto internal/tinyxml2-3.0.0/libtinyxml2.so.3.0.0 -lpthread
[  170s] CMakeFiles/encfs.dir/encfs/base64.cpp.o: In function `el::base::MessageBuilder::operator<<(char const*)':
[  170s] /home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: undefined reference to `el::base::elStorage'
[  170s] /home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: undefined reference to `el::base::elStorage'
[  170s] CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o: In function `el::base::MessageBuilder::operator<<(char const*)':
[  170s] /home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: undefined reference to `el::base::elStorage'
[  170s] /home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: undefined reference to `el::base::elStorage'
[  170s] /home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: undefined reference to `el::base::elStorage'
[  170s] CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o:/home/abuild/rpmbuild/BUILD/encfs-1.9.1/internal/easylogging++.h:2911: more undefined references to `el::base::elStorage' follow
[  170s] collect2: error: ld returned 1 exit status
[  170s] CMakeFiles/encfs.dir/build.make:829: recipe for target 'libencfs.so.1.9.1' failed
          

I just hit this. If you're not getting it, it seems it is more than likely the lack of defining INITIALIZE_EASYLOGGINGPP. @mkhan3189 BTW, it may be helpful to put a note of that in your Quick Start to help identify the correlation. I had initially just built with the source included, not trying to use the logger, figuring it should just build with no side effects. This is why didn't have INITIALIZE_EASYLOGGINGPP declared in my code.

someone told me that I may have forgotten INITIALIZE_EASYLOGGINGPP this is where reference is defined to elStorage.
but i used it in one file of my project,then i can use LOG(INFO) << "***** info log *****"; but when i want to use LOG(INFO)<< in another file in the same project and it #include "easylogging++.h" too,but when i use make ,error occurs

libbitcoin_server.a(libbitcoin_server_a-init.o): In function el::base::MessageBuilder::operator<<(char const*)': /home/cici/work/tscminer/tsc-pow/src/easylogging++.h:2888: undefined reference to el::base::elStorage' libbitcoin_server.a(libbitcoin_server_a-easylogging++.o): In function el::base::MessageBuilder::initialize(el::Logger*)': /home/cici/work/tscminer/tsc-pow/src/easylogging++.cc:2509: undefined reference to el::base::elStorage' libbitcoin_server.a(libbitcoin_server_a-easylogging++.o): In function el::base::MessageBuilder::operator<<(wchar_t const*)': /home/cici/work/tscminer/tsc-pow/src/easylogging++.cc:2524: undefined reference to el::base::elStorage' libbitcoin_server.a(libbitcoin_server_a-easylogging++.o): In function el::Loggers::setDefaultLogBuilder(std::shared_ptrel::LogBuilder&)': /home/cici/work/tscminer/tsc-pow/src/easylogging++.cc:2947: undefined reference to el::base::elStorage' libbitcoin_server.a(libbitcoin_server_a-easylogging++.o): In function el::Loggers::defaultConfigurations()': /home/cici/work/tscminer/tsc-pow/src/easylogging++.cc:3004: undefined reference to el::base::elStorage' libbitcoin_server.a(libbitcoin_server_a-easylogging++.o):/home/cici/work/tscminer/tsc-pow/src/easylogging++.cc:3008: more undefined references to el::base::elStorage' follow `