1
votes

I've installed these files from their site:

  • Qt 5.3.1 for Windows 64-bit (VS 2013, OpenGL, 571 MB)
  • Visual Studio Add-in 1.2.3 for Qt5

After that, I tried to follow this simple tutorial but when I try to actually build the generated project it fails at linking saying "error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'". I did exactly as the guy in the tutorial says, changed the Target Machine to Machine64 and set the platform to be x64. If I try to build it as Win32, the following message box pops up.:

enter image description here

I've set the "Qt Version" path to C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl. Maybe that's what's bothering the linker? On a side note, I have three projects in the solution - two of them are x86 and the Qt one is x64.

UPDATE: Everything works just fine in Qt Creator.

UPDATE 2: Qt project's vcxproj.user file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ShowAllFiles>true</ShowAllFiles>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <QTDIR>C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl</QTDIR>
    <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <QTDIR>C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl</QTDIR>
    <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LocalDebuggerEnvironment>PATH="$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
    <QTDIR>C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl</QTDIR>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LocalDebuggerEnvironment>PATH="$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
    <QTDIR>C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl</QTDIR>
  </PropertyGroup>
</Project>
2
what happen if you do a rebuild in either architecture? for x64 PATH="$(QTDIR)\bin%3b$(PATH). There is an opening quaotation mark which is not closed. - UmNyobe
Right click on your project -> Qt project settings -> Properties tab -> Version (change here via drop down to the right of the label) - W.B.
@W.B. It is already set to the one I defined in Qt Options -> Qt Versions. - Venom
@UmNyobe I either get the LNK1112 error or the message box pops up. - Venom
@Venom you have a typo on the path for 64 bit - UmNyobe

2 Answers

0
votes

Solved by exchanging the x64 edition of Qt with the x86 one. The project builds and runs as expected.

0
votes

Your issue is that both 32 bit and 64 bits of your app are configured to link with Qt 64 bits. The 32 bit version requires Qt 32 bits and the 64 bit version requires Qt 32 bit. A successful configuration would set <QTDIR> to C:\Qt\Qt5.3.1\5.3\msvc2013_32_opengl on win32 and C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl on x64.