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. linker errors on all objects from Qt libraries after updating Qt
Forum Updated to NodeBB v4.3 + New Features

linker errors on all objects from Qt libraries after updating Qt

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 4 Posters 2.9k 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.
  • H Offline
    H Offline
    Hasan Al-Baghdadi
    wrote on last edited by Hasan Al-Baghdadi
    #1

    So I recently updated from Qt 5.11.2 to 5.12.1. and of course, configured my projects without modifying the .pro file, but every time I try to execute my project, every usage of a Qt function, as well as some of my constructors, return a linker error starting with "Undefined reference to `_imp...".

    I've tried cleaning and running QMake, but that didn't seem to fix it. Is there anything I missed?

    Edit:
    A few extra notes I feel like I should include:

    • I am using QtCreator and running on windows with the build settings set to run using MinGW 64-bit
    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      are both 11.2 and 12.1 installed concurrently on your system? What happens if you create a new project and then build it?

      If you meet the AI on the road, kill it.

      H 1 Reply Last reply
      1
      • Kent-DorfmanK Kent-Dorfman

        are both 11.2 and 12.1 installed concurrently on your system? What happens if you create a new project and then build it?

        H Offline
        H Offline
        Hasan Al-Baghdadi
        wrote on last edited by
        #3

        @Kent-Dorfman

        are both 11.2 and 12.1 installed concurrently on your system?

        No, I've uninstalled 11.2.

        What happens if you create a new project and then build it?

        The same thing.

        I feel like I should also mention that this has been happening while using Qt Creator 4.8.0 and I'm not building the project myself.

        Thanks.

        Kent-DorfmanK 1 Reply Last reply
        0
        • H Hasan Al-Baghdadi

          @Kent-Dorfman

          are both 11.2 and 12.1 installed concurrently on your system?

          No, I've uninstalled 11.2.

          What happens if you create a new project and then build it?

          The same thing.

          I feel like I should also mention that this has been happening while using Qt Creator 4.8.0 and I'm not building the project myself.

          Thanks.

          Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          @Hasan-Al-Baghdadi

          I don't use creator, but build projects manually:

          qmake5 -project
          {edit project file}
          qmake5
          make
          

          next, try a manual project creation (outside of creator)

          If you meet the AI on the road, kill it.

          H 1 Reply Last reply
          2
          • Kent-DorfmanK Kent-Dorfman

            @Hasan-Al-Baghdadi

            I don't use creator, but build projects manually:

            qmake5 -project
            {edit project file}
            qmake5
            make
            

            next, try a manual project creation (outside of creator)

            H Offline
            H Offline
            Hasan Al-Baghdadi
            wrote on last edited by
            #5

            @Kent-Dorfman

            Thanks for your help, I apoligise for the late reply.
            I'm developing on windows and I assume you're on Linux, so I'm not sure how much you'd be able to help.

            I tried following your instructions and when I ran mingw32-make.exe I got the following error

            mingw32-make.exe: Nothing to be done for 'first'.

            I'm not sure if this even points to the original issue.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              This means that everything was already built. Did you try to nuke the build folder and start again ?

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

              H 1 Reply Last reply
              2
              • SGaistS SGaist

                Hi,

                This means that everything was already built. Did you try to nuke the build folder and start again ?

                H Offline
                H Offline
                Hasan Al-Baghdadi
                wrote on last edited by
                #7

                @SGaist
                Hi, thanks for your help.
                That seems to have fixed the Qt specific errors, but now I'm getting different Errors where most classes (both mine and Qt's) are considered incomplete and the compiler is unable to find any stdlib files with errors such as 'iostream' file not found.

                I suspect this might be a kit error so I've provided a screenshot of my kit setting, but it doesn't look like anything is wrong with it.

                https://imgur.com/a/wo6JEE5

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Can you show your .pro file ?

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

                  1 Reply Last reply
                  1
                  • H Offline
                    H Offline
                    Hasan Al-Baghdadi
                    wrote on last edited by
                    #9

                    Hi, apologies for the late reply.

                    I have multiple projects and they all have the same issue. With the .pro file having no effect.

                    As an example, I quickly created a new project and here are images of both the .pro file and the main.cpp file.

                    alt text
                    alt text

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Does the kit you are using show any warning/error ?

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

                      1 Reply Last reply
                      1
                      • H Offline
                        H Offline
                        Hasan Al-Baghdadi
                        wrote on last edited by
                        #11

                        The kit is showing a few warnings.

                        • Warning: no Debugger set up.
                        • Warning: CMake configuration has a path to a C compiler set, even though the kit has no valid tool chain.
                        • Warning: CMake configuration has a path to a C++ compiler set, even though the kit has no valid tool chain.

                        alt text

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Do you have both MinGW 32 and 64 bit installed ?

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

                          1 Reply Last reply
                          1
                          • H Offline
                            H Offline
                            Hasan Al-Baghdadi
                            wrote on last edited by Hasan Al-Baghdadi
                            #13

                            Thanks,

                            I have MinGW64 installed via the Qt installer with all the libraries and such, and a 32bit MinGW exists on my machine independent of Qt with none of the Qt libraries compiled in it. Could this somehow be interfering with my qt kit?

                            Edit: I also used to have old now uninstalled mingw530_32 and mignw730_32 installed under qt tools as well as old, now uninstalled 32bit compiler for 5.11.2

                            aha_1980A 1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              If you don't need it, I would remove that version of MinGW and retry.

                              If still not working, then I would re-install the Qt SDK.

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

                              1 Reply Last reply
                              2
                              • H Hasan Al-Baghdadi

                                Thanks,

                                I have MinGW64 installed via the Qt installer with all the libraries and such, and a 32bit MinGW exists on my machine independent of Qt with none of the Qt libraries compiled in it. Could this somehow be interfering with my qt kit?

                                Edit: I also used to have old now uninstalled mingw530_32 and mignw730_32 installed under qt tools as well as old, now uninstalled 32bit compiler for 5.11.2

                                aha_1980A Offline
                                aha_1980A Offline
                                aha_1980
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                @Hasan-Al-Baghdadi

                                I really think there is a 32/64 bit mixup.

                                In your tooltip, e.g. the debugger seems to be 32bit while the C++ compiler is 64. I cannot see the C compiler, please click on the Kit to open the details.

                                We had some users recently complaining about similar problems, so there might be some setup bug involved, we just don't know yet what really goes wrong.

                                Regards

                                Qt has to stay free or it will die.

                                1 Reply Last reply
                                2
                                • H Offline
                                  H Offline
                                  Hasan Al-Baghdadi
                                  wrote on last edited by Hasan Al-Baghdadi
                                  #16

                                  @aha_1980

                                  In your tooltip, e.g. the debugger seems to be 32bit while the C++ compiler is 64. I cannot see the C compiler, please click on the Kit to open the details.

                                  This is my kit, at the moment it's all the default settings, does anything in it look incorrect or suspicious.

                                  alt text

                                  @SGaist

                                  If you don't need it, I would remove that version of MinGW and retry.

                                  If still not working, then I would re-install the Qt SDK.

                                  I've removed the other version of MinGW installed on my PC, then uninstalled and reinstalled the MinGW 7.3.0 64-bit SDK, unfortunately, that doesn't seem to have fixed anything.

                                  Edit: I just checked the compile output and the follwoing error is returned, it does sound like it has something to do with the kit: Error while building/deploying project RunnyHoney (kit: Desktop Qt 5.12.1 MinGW 64-bit) The kit Desktop Qt 5.12.1 MinGW 64-bit has configuration issues which might be the root cause for this problem. When executing step "Make"

                                  1 Reply Last reply
                                  0
                                  • H Offline
                                    H Offline
                                    Hasan Al-Baghdadi
                                    wrote on last edited by
                                    #17

                                    I just fixed it, by removing the old MinGW from my environment variables and adding the new MinGW's binary directory.

                                    Thanks you very much for your help

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      Where did you modify that environment variable ?

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

                                      1 Reply Last reply
                                      0
                                      • H Offline
                                        H Offline
                                        Hasan Al-Baghdadi
                                        wrote on last edited by
                                        #19

                                        Sorry for the late reply.

                                        I removed the MinGW 32 binary path from Window's default environment variables' path variable and added the MinGW 64 binary path from Qt tools.

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #20

                                          You should rather not have it in your machine global PATH environnement variable.

                                          Usually Qt Creator handles that for you per project so you don't have nasty surprises.

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

                                          1 Reply Last reply
                                          1

                                          • Login

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