Using Qt 5.7 with MSVC compiler
Hi all, hope this is the right place to post my issue.
From several days, i'm trying to compile my project with the new Qt 5.7 library on Windows 10.
Before(Qt 5.5), i was using Mingw(still on Windows 10) and everyting was going fine.
The problem is that in this project i need to use qtwebkit so i ported everything to qtwebengine.(qtwebkit seems to be replaced by qtwebengine http://doc.qt.io/qt-5/qtwebengine-overview.html)
Unfortunately, Mingw does not support qtwebengine, so i had to download and use MSVC compiler from Visual Studio.
Now everytime i try to compile with MSVC2013 compiler i get this error:
C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(147) : fatal error C1189: #error : "No Target Architecture"
and the compiler point me inside the file winnt.h:
Code:
#elif !defined(RC_INVOKED)
#error "No Target Architecture"
#endif
what i'm doing wrong?
Thanks to all.
Re: Using Qt 5.7 with MSVC compiler
I know this is very old, but I ran into the same problem and could not find a solution online, so I'm hopefully going to save someone else the trouble in the future.
The problem is that you are missing either "_x86_" (for 32 bit) or "_AMD64" (for 64 bit) in your "DEFINES" variable. Additionally, in my case I ended up having to remove a few extra defines that Qt put in automatically. Here's how I fixed this issue in my .pro file:
Code:
DEFINES += _AMD64_
DEFINES -= WIN32 WIN64
Hope this helps.
Re: Using Qt 5.7 with MSVC compiler
The error you're encountering, "No Target Architecture," occurs because the compiler isn't detecting a target architecture for the build. Here’s what you can try to fix it:
Verify the correct MSVC compiler is selected: Ensure you have selected a 32-bit or 64-bit architecture for MSVC in Qt Creator by choosing the proper kit in the build settings (x86 for 32-bit or x64 for 64-bit).
Install necessary SDKs: Make sure you have the correct Windows SDK installed. The error points to missing or incompatible SDK files. You may need to install the Windows 8.1 or Windows 10 SDK from the Visual Studio installer.
Update your environment variables: Ensure your development environment (Qt Creator) is properly configured with the correct environment variables for the MSVC toolchain.
Use the correct MSVC version: Since you mentioned MSVC2013, ensure you are using Qt compiled with the same MSVC version. If you're using a newer Qt version (like 5.7), try upgrading your compiler to MSVC2015 or later, as older compilers might not work well with newer Qt libraries.
By verifying these configurations, you should be able to resolve the issue and successfully compile your project.