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. What is the solution of this error?
Forum Updated to NodeBB v4.3 + New Features

What is the solution of this error?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.1k Views 2 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.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    I get this error ONLY when I use SDL Libraries.

    (.qtversion[qt_version_tag]+0x0):-1: error: undefined reference to `qt_version_tag'

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, that 'qt_version_tag' is Qt checking that it loads the correct .so files (for example the libQt5Core.so.5 that belongs to 5.7). So if you get a message about "undefined reference to qt_version_tag" that means Qt is trying to load an old/wrong dll.

      1 Reply Last reply
      1
      • mit_cruzeM Offline
        mit_cruzeM Offline
        mit_cruze
        wrote on last edited by
        #3

        Is there any solution If you know, please help me out!
        I am running Qt 5.7 on ubunutu

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Hi, check that you've #included "qglobal.h" in all .cpp files. (That's where the qt_version_tag is defined.)

          kshegunovK 1 Reply Last reply
          1
          • mit_cruzeM Offline
            mit_cruzeM Offline
            mit_cruze
            wrote on last edited by
            #5

            THanks but still no luck!

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              Hmm, how's the output from ldd your-app? Perhaps there's some 5.5.1 libraries in there (because Ubuntu 16.04 comes with Qt 5.5.1 pre-installed).

              1 Reply Last reply
              2
              • hskoglundH hskoglund

                Hi, check that you've #included "qglobal.h" in all .cpp files. (That's where the qt_version_tag is defined.)

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #7

                @hskoglund said in What is the solution of this error?:

                Hi, check that you've #included "qglobal.h" in all .cpp files. (That's where the qt_version_tag is defined.)

                Henry, you've mentioned this before, so I went on and checked. It doesn't matter whether you include <QtGlobal> as the versioning tag is generated only when Qt's compiled (which I suspected, hence the double-check ;)). See here (notice the ifdef) and here (note the extern const char * that's built with the macro). However I do believe you were right the first time and the error is popping up because of binaries that are incompatible (it was when I encountered it).

                @mit_cruze said in What is the solution of this error?:

                THanks but still no luck!

                As @hskoglund says, make sure you're not mixing up Qt builds.

                Read and abide by the Qt Code of Conduct

                hskoglundH 1 Reply Last reply
                2
                • kshegunovK kshegunov

                  @hskoglund said in What is the solution of this error?:

                  Hi, check that you've #included "qglobal.h" in all .cpp files. (That's where the qt_version_tag is defined.)

                  Henry, you've mentioned this before, so I went on and checked. It doesn't matter whether you include <QtGlobal> as the versioning tag is generated only when Qt's compiled (which I suspected, hence the double-check ;)). See here (notice the ifdef) and here (note the extern const char * that's built with the macro). However I do believe you were right the first time and the error is popping up because of binaries that are incompatible (it was when I encountered it).

                  @mit_cruze said in What is the solution of this error?:

                  THanks but still no luck!

                  As @hskoglund says, make sure you're not mixing up Qt builds.

                  hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #8

                  @kshegunov Yes, you're right, I wasn't checking when/where the versioning tag is defined. Slightly confused, that error above: ... undefined reference to `qt_version_tag' is a linking error, right? But the similar error you got before, wasn't that when you tried to start you app?

                  kshegunovK 1 Reply Last reply
                  0
                  • hskoglundH hskoglund

                    @kshegunov Yes, you're right, I wasn't checking when/where the versioning tag is defined. Slightly confused, that error above: ... undefined reference to `qt_version_tag' is a linking error, right? But the similar error you got before, wasn't that when you tried to start you app?

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

                    @hskoglund said in What is the solution of this error?:

                    Slightly confused, that error above: ... undefined reference to `qt_version_tag' is a linking error, right? But the similar error you got before, wasn't that when you tried to start you app?

                    Yes I got it on loading, because I had unintentionally substituted the binaries my application is linked to.

                    As for your first question:
                    There's little distinction on Linux as the symbol resolution will be actually done at run-time (in contrast to Windows); and that's one big mother of a pitfall. :)

                    Read and abide by the Qt Code of Conduct

                    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