When LOG4QT_VERSION_STR not declare error will come ?
-
I am using Log4Qt-1.4.2 library in qt. when i add that in my project i am getting below error
/home/Log4Qt-1.4.2/src/log4qt/logmanager.cpp:354: error: 'LOG4QT_VERSION_STR' was not declared in this scope
QLatin1String(LOG4QT_VERSION_STR));
^I am using qt creator with version 5.5.1.
What is solution of this error?
-
Hi,
How are you using it ?
-
@SGaist I have zip file of log4qt version 1.4.2 when I extract it it creates folder. I am copy extracted folder in project source code. Then include path of .pri file in. Pro file of project.
include(/src/log4qt/log4qt.pri)
I have found that this macro need to be declared in log4qt namespace in log4qt.h file.
i have declared it like
#define LOG4QT_VERSION_STR "0.3.0"
it removed my error. but exactly why it not declared in log4qt.h for 1.4.2 version of library of log4qt ?
-
The LOG4QT_VERSION_STR macro is passed in to the compiler by the inclusion of build.pri when you build the library using qmake. Since you are not (for unstated reasons) building the library I suggest you also need to include that file or make similar PRO file DEFINES entries.
include(/src/log4qt/log4qt.pri)
The Log4Qt source code PRI file exists at /src/log4qt/log4qt.pri ? This seems unlikely if you have put it in your own project source folder somewhere. Probably should be a relative path.
-
@Qt-embedded-developer said in When LOG4QT_VERSION_STR not declare error will come ?:
No this is not exact path " /src/log4qt/log4qt.pri ". i have added m
Then please post what you really have in your pro file...