Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved When LOG4QT_VERSION_STR not declare error will come ?

    General and Desktop
    4
    7
    180
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      Qt embedded developer last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        How are you using it ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply Reply Quote 0
        • Q
          Qt embedded developer @SGaist last edited by Qt embedded developer

          @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 ?

          1 Reply Last reply Reply Quote 0
          • C
            ChrisW67 last edited by

            @Qt-embedded-developer

            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.

            Q 1 Reply Last reply Reply Quote 0
            • Q
              Qt embedded developer @ChrisW67 last edited by

              @ChrisW67 No this is not exact path " /src/log4qt/log4qt.pri ". i have added my relative path.

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @Qt embedded developer last edited by

                @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...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q 1 Reply Last reply Reply Quote 2
                • Q
                  Qt embedded developer @jsulm last edited by Qt embedded developer

                  @jsulm

                  Sorry i can not write whole file here. but part which i include in that i mention below:

                  include(/home/man/WORK_S/Project/24july21_log/proj/trunk/Log4Qt-1.4.2/src/log4qt/log4qt.pri)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post