linker errors on all objects from Qt libraries after updating Qt
-
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
-
are both 11.2 and 12.1 installed concurrently on your system? What happens if you create a new project and then build it?
-
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.
-
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)
-
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 errormingw32-make.exe: Nothing to be done for 'first'.
I'm not sure if this even points to the original issue.
-
Hi,
This means that everything was already built. Did you try to nuke the build folder and start again ?
-
@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.
-
Can you show your .pro file ?
-
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.
-
Does the kit you are using show any warning/error ?
-
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.
-
Do you have both MinGW 32 and 64 bit installed ?
-
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
-
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 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
-
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.
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"
-
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
-
Where did you modify that environment variable ?
-
Sorry for the late reply.
I removed the
MinGW 32
binary path from Window's default environment variables'path
variable and added theMinGW 64
binary path from Qt tools. -
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.