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. Undefined reference to qt_version_tag

Undefined reference to qt_version_tag

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 6 Posters 24.3k Views 4 Watching
  • 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.
  • G Offline
    G Offline
    ghkraju
    wrote on last edited by
    #3

    I am using boost from distro and qt from online

    I tried to compile boost from online to the latest version 1.61 but they are in the separate folder. When i check in terminal : dpkg -S /usr/include/boost/version.hpp
    libboost1.58-dev:amd64: /usr/include/boost/version.hpp

    Ohhhh Strange!!!! Check this:
    qmake --version
    QMake version 3.0
    Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

    Is this causing the problem? How can i change my qmake version to online installed version of qt?

    Paul ColbyP 1 Reply Last reply
    0
    • G ghkraju

      I am using boost from distro and qt from online

      I tried to compile boost from online to the latest version 1.61 but they are in the separate folder. When i check in terminal : dpkg -S /usr/include/boost/version.hpp
      libboost1.58-dev:amd64: /usr/include/boost/version.hpp

      Ohhhh Strange!!!! Check this:
      qmake --version
      QMake version 3.0
      Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

      Is this causing the problem? How can i change my qmake version to online installed version of qt?

      Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by Paul Colby
      #4

      @ghkraju said in Undefined reference to qt_version_tag:

      How can i change my qmake version to online installed version of qt?

      Just run qmake with a fully-qualified path (depends on where you installed Qt from the online installer). For example, on one of my dev hosts:

      paul@paul-XPS-13-9343:~$ qmake -v
      QMake version 3.0
      Using Qt version 5.6.1 in /usr/lib/x86_64-linux-gnu
      paul@paul-XPS-13-9343:~$ ~/opt/qt/5.6/gcc_64/bin/qmake -v
      QMake version 3.0
      Using Qt version 5.6.2 in /home/paul/opt/qt/5.6/gcc_64/lib
      paul@paul-XPS-13-9343:~$ ~/opt/qt/5.7/gcc_64/bin/qmake -v
      QMake version 3.0
      Using Qt version 5.7.0 in /home/paul/opt/qt/5.7/gcc_64/lib
      paul@paul-XPS-13-9343:~$ 
      

      So currently I can use Qt 5.6.1 (official Ubuntu package), 5.6.2 or 5.7.0 depending on which qmake I run.

      Of course, you can also setup shell aliases, modify your shell's execution path order, etc. Whatever works best for you.

      Cheers.

      1 Reply Last reply
      1
      • G Offline
        G Offline
        ghkraju
        wrote on last edited by
        #5

        It works fine for the other projects.... The problem arises only when i add boost library in .pro file

        1 Reply Last reply
        0
        • Paul ColbyP Offline
          Paul ColbyP Offline
          Paul Colby
          wrote on last edited by
          #6

          I expect the problem is related to:

          LIBS += -L"/usr/lib/x86_64-linux-gnu"
          

          In this case, you're explicitly adding the path that contains Ubuntu's Qt 5.5.1 libraries, so when you run qmake from the online installer (or in this case, it looks like Qt Creator is (correctly) running it for you), you're essentially ending up with a potential Qt version clash, depending on the final order of the linker flags.

          I'd start by simply removing the -L... flag. It shouldn't be necessary (that path should already be set appropriately by the host OS's ldconfig, and I'd expect qmake to handle the final flag ordering correctly by default).

          If that then results in the linker complaining about not finding libboost_system, then I'd check you host OS's ldconfig, and/or use a full-path to the libboost_system library.

          Cheers.

          A 1 Reply Last reply
          4
          • G Offline
            G Offline
            ghkraju
            wrote on last edited by
            #7

            Superb...!!!! Thank you...... It works now.

            1 Reply Last reply
            1
            • Paul ColbyP Paul Colby

              I expect the problem is related to:

              LIBS += -L"/usr/lib/x86_64-linux-gnu"
              

              In this case, you're explicitly adding the path that contains Ubuntu's Qt 5.5.1 libraries, so when you run qmake from the online installer (or in this case, it looks like Qt Creator is (correctly) running it for you), you're essentially ending up with a potential Qt version clash, depending on the final order of the linker flags.

              I'd start by simply removing the -L... flag. It shouldn't be necessary (that path should already be set appropriately by the host OS's ldconfig, and I'd expect qmake to handle the final flag ordering correctly by default).

              If that then results in the linker complaining about not finding libboost_system, then I'd check you host OS's ldconfig, and/or use a full-path to the libboost_system library.

              Cheers.

              A Offline
              A Offline
              Alexander-9
              wrote on last edited by Alexander-9
              #8

              @Paul-Colby, Hi this line LIBS += -L"/usr/lib/x86_64-linux-gnu" is add in .pro??, i worked with cross-compiler application.

              mrjjM 1 Reply Last reply
              0
              • A Alexander-9

                @Paul-Colby, Hi this line LIBS += -L"/usr/lib/x86_64-linux-gnu" is add in .pro??, i worked with cross-compiler application.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #9

                @Alexander-9
                Hi
                yes the LIBS += is for the .pro file

                http://doc.qt.io/qt-5/qmake-variable-reference.html#libs

                But i think it worked by removing it.

                A 1 Reply Last reply
                1
                • mrjjM mrjj

                  @Alexander-9
                  Hi
                  yes the LIBS += is for the .pro file

                  http://doc.qt.io/qt-5/qmake-variable-reference.html#libs

                  But i think it worked by removing it.

                  A Offline
                  A Offline
                  Alexander-9
                  wrote on last edited by
                  #10

                  @mrjj, Hi i already add in .pro, but i have el same problem:

                  12:17:20: Running steps for project Imx6-Widget...
                  12:17:20: Configuration unchanged, skipping qmake step.
                  12:17:20: Starting: "/usr/bin/make"
                  g++ -o Imx6-Widget main.o qrc_qml.o -L/usr/lib/x86_64-linux-gnu -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread
                  main.o:(.qtversion[qt_version_tag]+0x0): referencia a `qt_version_tag' sin definir
                  Makefile:199: fallo en las instrucciones para el objetivo 'Imx6-Widget'
                  collect2: error: ld returned 1 exit status
                  make: *** [Imx6-Widget] Error 1
                  12:17:20: The process "/usr/bin/make" exited with code 2.
                  Error while building/deploying project Imx6-Widget (kit: arm)
                  When executing step "Make"
                  12:17:20: Elapsed time: 00:00.

                  Any suggestions to solve it??

                  mrjjM 1 Reply Last reply
                  0
                  • A Alexander-9

                    @mrjj, Hi i already add in .pro, but i have el same problem:

                    12:17:20: Running steps for project Imx6-Widget...
                    12:17:20: Configuration unchanged, skipping qmake step.
                    12:17:20: Starting: "/usr/bin/make"
                    g++ -o Imx6-Widget main.o qrc_qml.o -L/usr/lib/x86_64-linux-gnu -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread
                    main.o:(.qtversion[qt_version_tag]+0x0): referencia a `qt_version_tag' sin definir
                    Makefile:199: fallo en las instrucciones para el objetivo 'Imx6-Widget'
                    collect2: error: ld returned 1 exit status
                    make: *** [Imx6-Widget] Error 1
                    12:17:20: The process "/usr/bin/make" exited with code 2.
                    Error while building/deploying project Imx6-Widget (kit: arm)
                    When executing step "Make"
                    12:17:20: Elapsed time: 00:00.

                    Any suggestions to solve it??

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    @Alexander-9
                    As I read the post above the posts above, it should not be included in this case.
                    It made it use wrong Qt version.
                    as @Paul-Colby says
                    "I'd start by simply removing the -L... flag. It shouldn't be necessary"

                    and poster says "It works now."

                    so it seems its not needed and should not be included.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      aktay
                      wrote on last edited by
                      #12

                      Hi,
                      I am cross-compiling for Toradex apalis-tk1. I have that same problem. Can you help with this?

                      ~$ qmake -v
                      QMake version 3.0
                      Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu
                      ~$ ~/toradex-sdk/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake -v
                      QMake version 3.0
                      Using Qt version 5.7.1 in /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib
                      
                      
                      11:41:53: Running steps for project testQmake...
                      11:41:53: Configuration unchanged, skipping qmake step.
                      11:41:53: Starting: "/usr/bin/make" 
                      /home/abdullah/toradex-sdk/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../testQmake/testQmake.pro
                      g++  -o testQmake main.o qrc_qml.o   -L/home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib -lQt5Quick -L/home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/arm-linux-gnueabihf/tegra -L/home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Quick.so when searching for -lQt5Quick
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libQt5Quick.so when searching for -lQt5Quick
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Gui.so when searching for -lQt5Gui
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libQt5Gui.so when searching for -lQt5Gui
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Qml.so when searching for -lQt5Qml
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libQt5Qml.so when searching for -lQt5Qml
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Network.so when searching for -lQt5Network
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libQt5Network.so when searching for -lQt5Network
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libQt5Core.so when searching for -lQt5Core
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libGL.so when searching for -lGL
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libpthread.so when searching for -lpthread
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libpthread.so when searching for -lpthread
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libpthread.a when searching for -lpthread
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libstdc++.so when searching for -lstdc++
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libstdc++.so when searching for -lstdc++
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libstdc++.a when searching for -lstdc++
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libm.so when searching for -lm
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libm.so when searching for -lm
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libm.a when searching for -lm
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libc.so when searching for -lc
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libc.so when searching for -lc
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex/oe-core/build/tmp-glibc/sysroots/apalis-tk1/usr/lib/libc.a when searching for -lc
                      main.o:(.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag'
                      collect2: error: ld returned 1 exit status
                      make: *** [testQmake] Error 1
                      11:41:53: The process "/usr/bin/make" exited with code 2.
                      Error while building/deploying project testQmake (kit: TK1)
                      When executing step "Make"
                      11:41:53: Elapsed time: 00:00.
                      

                      When I add LIBS += -L"/usr/lib/x86_64-linux-gnu" to the Pro file.

                      11:46:45: Running steps for project testQmake...
                      11:46:45: Configuration unchanged, skipping qmake step.
                      11:46:45: Starting: "/usr/bin/make" 
                      /home/abdullah/toradex-sdk/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../testQmake/testQmake.pro
                      g++  -o testQmake main.o qrc_qml.o   -L/usr/lib/x86_64-linux-gnu -L/home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib -lQt5Quick -L/usr/X11R6/lib64 -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 
                      /usr/bin/ld: skipping incompatible /home/abdullah/toradex-sdk/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libstdc++.so when searching for -lstdc++
                      main.o:(.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag'
                      collect2: error: ld returned 1 exit status
                      make: *** [testQmake] Error 1
                      11:46:45: The process "/usr/bin/make" exited with code 2.
                      Error while building/deploying project testQmake (kit: TK1)
                      When executing step "Make"
                      11:46:45: Elapsed time: 00:00.
                      

                      Thanks.

                      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