Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

I have error when i use the "make" instruction #76

Open
TY-cc opened this issue Jul 18, 2024 · 1 comment
Open

I have error when i use the "make" instruction #76

TY-cc opened this issue Jul 18, 2024 · 1 comment

Comments

@TY-cc
Copy link

TY-cc commented Jul 18, 2024

The error as follow:
[ 52%] Built target apsi [ 54%] Linking CXX executable bin/unit_tests lib/libapsi-0.12.a(log.cpp.o): In function apsi::Log::DoLog(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, apsi::Log::Level)':
log.cpp:(.text+0x16f): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' log.cpp:(.text+0x191): undefined reference to log4cplus::Logger::log(int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*, int, char const*) const'
lib/libapsi-0.12.a(log.cpp.o): In function apsi::Log::SetLogLevel(apsi::Log::Level)': log.cpp:(.text+0x223): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
lib/libapsi-0.12.a(log.cpp.o): In function apsi::Log::Configure()': log.cpp:(.text+0x374): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
log.cpp:(.text+0x44b): undefined reference to log4cplus::PatternLayout::PatternLayout(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' log.cpp:(.text+0x49e): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
log.cpp:(.text+0x541): undefined reference to log4cplus::RollingFileAppender::RollingFileAppender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, int, bool, bool)' log.cpp:(.text+0x5d1): undefined reference to log4cplus::PatternLayout::PatternLayout(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
log.cpp:(.text+0x624): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' log.cpp:(.text+0x6ff): undefined reference to log4cplus::Logger::getInstance(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/unit_tests] Error 1
make[1]: *** [CMakeFiles/unit_tests.dir/all] Error 2
make: *** [all] Error 2`

How do i modify the CMakeList.txt?

@kimlaine
Copy link
Contributor

For some reason the build system couldn't find log4cplus. When you configure the CMake project, does it show log4cplus as found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants