Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. When LOG4QT_VERSION_STR not declare error will come ?

When LOG4QT_VERSION_STR not declare error will come ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 481 Views
  • 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 Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • SGaistS SGaist

        Hi,

        How are you using it ?

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by Qt embedded developer
        #3

        @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
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          @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
          0
          • C ChrisW67

            @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 Offline
            Q Offline
            Qt embedded developer
            wrote on last edited by
            #5

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

            jsulmJ 1 Reply Last reply
            0
            • Q Qt embedded developer

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

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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
              2
              • jsulmJ jsulm

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

                Q Offline
                Q Offline
                Qt embedded developer
                wrote on last edited by Qt embedded developer
                #7

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

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved