Hi. I just downloaded and installed 1.1.1-rc3. When I link my current project I get the following error:
./main.o: In function `log4cplus::detail::macros_get_logger(log4cplus::Logger&&)': /home/ken/pool/include/log4cplus/loggingmacros.h:106: undefined reference to `log4cplus::Logger::Logger(log4cplus::Logger&&)'
I am still too new to C++ to fully understand the problem here. Does the above error make sense to you? Does this have to do with your new changes to loggingmacros.h
?
Thanks,
Ken
Diff:
It seems that you have not compiled log4cplus with C++11 support. Both the library and your application have to be compiled in the same "mode". If you want to compile log4cplus in C++11 mode than (if you are using GCC) add
CXXFLAGS="-std=c++11"
to theconfigure
script command line.Last edit: Václav Haisman 2013-03-17
Hi Vaclav,
Yes, that was indeed the problem. Although in my case I needed to use CXXFLAGS="-std=c++0x".
How could you tell this was the problem from the error messages I posted?
Thanks again!
Ken
The error message shows
macros_get_logger(log4cplus::Logger&&)
. The&&
there is rvalue reference which is a C++11 feature.Ticket moved from /p/log4cplus/support-requests/37/