Where to specify Zielcomputertyp "X64" - LNK1112 Error
I'm in progress of reinstalling and updating my QT environment as it didn't want to work anymore with formerly installed MSVC2015 x64 and current Win 10 Pro build.
My environment contains:
Windows 10 Pro Build 14393
Qt Creator 4.4.1 based on 5.9.2
I worked through some compiler issues yesterday and came to the point, that I'm getting this error message:
Qt5Widgetsd.lib(Qt5Widgetsd.dll) : fatal error LNK1112: Modul-Computertyp "x64" steht in Konflikt mit dem Zielcomputertyp "X86".
My target is to be able to compile and run my application in 64-bit architecture.
It looks to me like there is still one small setting to be adjusted, but I can't find the setting in Qt to do so.
The full linking output is:
10:02:58: Führe Schritte für Projekt untitled aus... 10:02:58: Unveränderte Konfiguration, qmake-Schritt wird übersprungen. 10:02:58: Starte "Y:\Mirrow\Qt\Tools\QtCreator\bin\jom.exe" Y:\Mirrow\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='22.214.171.124' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\untitled.exe @C:\Users\Dirk\AppData\Local\Temp\untitled.exe.4636.16.jom Qt5Widgetsd.lib(Qt5Widgetsd.dll) : fatal error LNK1112: Modul-Computertyp "x64" steht in Konflikt mit dem Zielcomputertyp "X86". jom: C:\temp\build-untitled-Desktop_Qt_5_9_2_MSVC2015_64bit-Debug\Makefile.Debug [debug\untitled.exe] Error 1112 jom: C:\temp\build-untitled-Desktop_Qt_5_9_2_MSVC2015_64bit-Debug\Makefile [debug] Error 2 10:03:02: Der Prozess "Y:\Mirrow\Qt\Tools\QtCreator\bin\jom.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts untitled (Kit: Desktop Qt 5.9.2 MSVC2015 64bit) Bei der Ausführung von Schritt "Make" 10:03:02: Verstrichene Zeit: 00:04.
Qt automatically created the MSVC 2015 Kit but did not assign the compiler properly. So I've finished the kit by choosing the following configuration:
![alt text](image url)
My pro-file looks like this now:
#------------------------------------------------- # # Project created by QtCreator 2017-10-14T13:52:00 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = untitled TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui CONFIG += mobility MOBILITY = win32: LIBS += -L$$PWD/'../../Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64/' -lshell32 INCLUDEPATH += $$PWD/'../../Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64' DEPENDPATH += $$PWD/'../../Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64' win32:!win32-g++: PRE_TARGETDEPS += $$PWD/'../../Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64/shell32.lib' else:win32-g++: PRE_TARGETDEPS += $$PWD/'../../Program Files (x86)/Windows Kits/10/Lib/10.0.15063.0/um/x64/libshell32.a'
I couldn't find the solution how to properly change the target environment to x64 while the Kit has already set everything I can see to x64. Help is highly appreciated. Thanks.
@DirkM Did you try to delete the build directory, run qmake and rebuild?
This post is deleted!
Just to be sure I cleared the folder, executed qmake and compiled again. Same issue. :-(
Do you also get that with a default project ?
@SGaist Yes, I do. Actually I'm just setting up the environment with a default project 'untitled1'.
when you configure your Project, make sure, that in "Buid-Umgebung" your path variable contains the
the windows 10 kit
C:\Program Files (x86)\Windows Kits\10\bin\x86;
that is not automatically added when you install the msvc debugger
I ran into the same problem.
@J.Hilk Thanks for the hint. I added the path (after checking that it exists on my maschine.), cleared the directory, execute qmake and compile. Unfortunately it didn't work. I also tried the path with exchanging x86 to x64. Do you have any other idea?
My environment configuration looks like this: