LNK1112: module type type "x64" conflicts with target machine type "X86": Qt creator

I have an application running on linux that I am trying to import into windows. I created all the libraries and also made changes to the .pro file. Now, when I try to build a project, I get this error:

error: LNK1112: module machine type 'x64' conflicts with target machine type 'X86' 

I am not sure what causes this problem. I am using a 32-bit Qt creator. I know that there are several links that talk about changing project properties, but they are all related to changing them in Visual Studio. I use Qt creator and run the project through the Qt UI. Therefore, I am not sure what changes should be made for project properties through Qt, if this needs to be resolved.

+5
source share
2 answers

I had the same problem, but my scenario was a bit different, I was oriented to the x64 architecture, and when I changed it to x86, I got this error, it took me a while to realize that I had to rebuild the project to fit the processor architectures .

+5
source

Obviously, you are compiling a 32-bit target, but some of your libraries are 64 bits, which you most likely already know.

Make sure that Qt Creator uses the correct compiler (VC ++, MinGW) and the machine model (32, 64 bit) for your specific project.

  • Open project

     File -> Open File or Project... -> ... -> yourproject.pro 
  • Make sure Qt Creator automatically detects a compiler that matches the machine model of your libraries.

     Tools -> Options -> Build & Run -> Kits 
  • Select (define) the required assembly kit and other parameters for your project.

     Select "Projects" from the left panel. In the upper pane is shown the associated Kits for your project. You can add more Kits with the "Add Kit v" button. Hovering the mouse over the associated Kits, a little arrow is shown. Clicking on it provides operations to apply to the Kit. You can change or remove the Kit from your project following this little arrow. 
  • Create a new Makefile based on the new information.

     Build -> Run qmake 
  • Recover from scratch.

     Build -> Rebuild All 
+2
source

Source: https://habr.com/ru/post/1210507/


All Articles