2

Now there is a problem when i want to compile a project which needs to ld liblog4cplus.a When i use the compile option -std=c++11 ,then there's an error

Undefined reference to 'log4cplus::Logger::operator=(log4cplus::Logger&&)'

but whole project needs the option -std=c++11
So how can i solve this problem?

PS : Compiled on Ubuntu 12.04 ,which gcc version:4.8.2 and liblog4cplus version:1.1.3

1
  • 2
    Is the library compiled with C++11 enabled? My guess is that it isn't. Commented Sep 21, 2015 at 6:25

2 Answers 2

1

You have to compile both your code and log4cplus library with or without the -std=c++11 flag. Mixed compilations are not supported.

Sign up to request clarification or add additional context in comments.

Comments

0

my solution:

log4cplus::Logger g_piano_logger; auto logger = log4cplus::Logger::getInstance(... g_logger = logger;

or rebuild log4cplus

note LOG4CPLUS_HAVE_RVALUE_REFS in log4cplus-1.1.1/include/log4cplus/logger.h

Logger& operator=(const Logger& rhs); #if defined (LOG4CPLUS_HAVE_RVALUE_REFS) Logger (Logger && rhs); Logger & operator = (Logger && rhs); #endif

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.