Qt module error - LNK 1112 in QtOpenGL

276 views Asked by At

I am trying to build a project (x64) connected with Qt library in Microsoft Visual Studio 2010. The project I want to compile was built using Visual Studio 2008.

I have all the dependencies added, downloaded compiled the Qt library 64-bit and done all the proper changes in project properties in VS 2010. Although, I get the error below:

 Error  2616 error LNK1112: module machine type 'X86' conflicts with
 target machine type 'x64'  D:\project\Windows\QtOpenGL4.lib(QtOpenGL4.dll)

I have checked my .dll and .lib files and they are an in x64 bit version. Also, my QtOpenGL4.dll file is in another path from the one mentioned in error.

Could it be an error from the QtOpenGL4 module? How could I solve this? Could you please help me?

The instructions I followed in order to build the 64-bit version of Qt are in this link : https://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started/Building_Qt_From_Source

2

There are 2 answers

0
MTs On

Finally I found a solution in my error. I compiled again the Qt library in 64-bit and entered all the proper values in project Properties. I also entered the proper path in

Project Properties -> Linker ->Input ->Additional Dependencies.

With the right paths it solved the linkage error for me.

I have to mention that I also downloaded the precompiled libraries from the answers in this link How to compile Qt for 64-bit Windows from a 32-bit environment with Visual C++ 2010 Express?

1
Sankar On

You are probably trying to link your 64-bit project with 32-bit Qt libraries.

This says more about the error you are facing.

Similarly, if you create one module with the x64 compiler and another module with the x86 compiler, and try to link them, the linker will generate LNK1112.

Check if you are using 64-bit precompiled Qt libraries.