Hi all,

googling around looking for a C++ logging framework I found this library (see http://www.drdobbs.com/cpp/225700666 and http://logging-cpp.sourceforge.net/).
I downloaded the source code (see http://i.cmpnet.com/ddj/images/artic...ogging-cpp.zip), then I extracted it in a directory.
In the subdir tst there are some application examples, there I decided to make a simple Qt application using the logging library (released as a bunch of header files) to see if the integration with Qt library was possible.
Here is my code, constructed from an existing example in the tst directory.

Qt Code:
  1. #include <QApplication>
  2.  
  3. //#define LOGGING_DISABLE
  4. #include "logging/logging.h"
  5. using namespace ::logging;
  6.  
  7. // logging levels can be disabled at compile time
  8. //LOGGING_DISABLE_LEVEL(::logging::Error);
  9. //LOGGING_DISABLE_LEVEL(::logging::Trace);
  10. //LOGGING_DISABLE_LEVEL(::logging::Warning);
  11. //LOGGING_DISABLE_LEVEL(::logging::Info);
  12.  
  13. int main(int argc, char **argv)
  14. {
  15. QApplication app(argc, argv);
  16.  
  17. log::emit() << "Hello World! with the logging framework"
  18. << log::endl << log::endl;
  19. log::emit() << "Print 15 in hexadecimal "
  20. << log::hex << 15 << log::endl;
  21. log::emit() << "Print 15 in decimal "
  22. << log::dec << 15 << log::endl;
  23. log::emit() << "Print 15 in octal "
  24. << log::oct << 15 << log::endl;
  25. log::emit() << "Print 15 in binary with a tab"
  26. << log::bin << log::tab << 15
  27. << log::endl << log::endl;
  28.  
  29. log::emit< Error>() << "Logging an Error"
  30. << log::endl;
  31. log::emit< Trace>() << "Logging a Trace"
  32. << log::endl;
  33. log::emit< Warning>() << "Logging a Warning"
  34. << log::endl;
  35. log::emit< Info>() << "Logging an Info"
  36. << log::endl;
  37.  
  38. return app.exec();
  39. }
To copy to clipboard, switch view to plain text mode 

Following the qmake project file I used to build my example (tst.pro):

Qt Code:
  1. TEMPLATE = app
  2. TARGET = qt
  3. DEPENDPATH += .
  4. INCLUDEPATH += ../include
  5. QMAKE_CXXFLAGS += -std=c++0x
  6. QMAKE_CFLAGS += -std=c++0x
  7.  
  8. # Input
  9.  
  10. LIBS += -L ../include
  11. SOURCES += qt.cpp
To copy to clipboard, switch view to plain text mode 

After creation of the Makefile (with command qmake tst.pro), I ran the make cmd, but I obtained following error:

Qt Code:
  1. g++ -c -pipe -std=c++0x -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I../include -I. -o qt.o qt.cpp
  2. In file included from ../include/logging/OutputStream.h:43,
  3. from ../include/logging/logging.h:44,
  4. from qt.cpp:4:
  5. ../include/logging/Logger.h:199: error: expected unqualified-id before ‘)’ token
  6. ../include/logging/Logger.h:200: error: expected primary-expression before ‘return’
  7. ../include/logging/Logger.h:200: error: expected ‘}’ before ‘return’
  8. ../include/logging/Logger.h:204: error: too few template-parameter-lists
  9. ../include/logging/Logger.h:209: error: expected declaration before ‘}’ token
  10. make: *** [qt.o] Error 1
To copy to clipboard, switch view to plain text mode 

I discovered that omitting the include instruction [CODE]#include <QApplication>[7CODE] (at line #1), commenting line #15 and using instruction
Qt Code:
  1. return 0
To copy to clipboard, switch view to plain text mode 
instead of
Qt Code:
  1. return app.exec();
To copy to clipboard, switch view to plain text mode 
al line #38 I can compile without errors the application.

Could be the problem arising because of some options used in the Makefile build by qmake?
Or in some missing options whose absence generates the reported errors?

Thanks in advance for the help you can give me.