user1337
user1337

Reputation: 69

Cannot statically build x64 version of QT (LNK1112 module machine type conflicts)

I want to create a static application with QT(5.4.1) and compile it with visual studio 2013 (with QT Add-in) in a x64 environment.

I downloaded the most recent source code and compiled it using VS well buried x64 command prompt. I made sure the platform was 64-bits in Task Manager→Details→Platform. Here is the configure command I ran:

**configure** -debug-and-release -opensource -platform win32-msvc2013 -static -nomake examples -nomake tests

Once I compile it with jom and properly link it to my project, I can only build it with the win 32 configuration. When I try the x64 configuration, I get:

Error   3   error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'   D:\....\Qt5Widgets.lib(qwidget.obj)

It obviously means my binaries are built in a 32 bits format. If it's the case, I have no idea how to build them in x64. Any Ideas? I have scoured the internet and many have reached my dead end without getting help.

Upvotes: 0

Views: 927

Answers (1)

Timo Geusch
Timo Geusch

Reputation: 24341

This link might help, even though it's for an older version of Qt.

Basically, you have to run your configure & build process in a 64 bit MSVC command prompt for it to build a 64 bit binary. I'd also guess that it's a good idea to start with a clean Qt environment if you have to build both 32 and 64 bit version.

Upvotes: 1

Related Questions