Issue while compiling in X64 with SFML in visual studio - c++

When I try compiling my project in X64 I always have the same error :
LNK1112: module machine type 'x64' conflicts with target machine type 'X86
I've already test all the solutions I found but i can't figure it out
my VC++ directory is fine :
$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmf\lib\amd64;$(WindowsSDK_LibraryPath_x64);
I've properly link the 64 bits version of the SFML in the C/C++ menu and in the linker...
Do you guys know why it's still throwing this ?

Go to your project property page, in "Linker -> Advanced", switch "Target Machine" to "MachineX64 "

Related

How could I migrate a win32 application to a x64 one?

Recently I worked on a facial recognition application in Visual Stuido 2015. In order to apply cuda libraries to the app, this app needs to migrate from win32 type to x64. I carefully change the configuration manager and moderate everything involved with x86 when making sure every extern dll or lib has its x64 version.
But after compiled in release mode, there is always a error message: "LNK1112 module computer type 'x86' conflicts target computer type 'x64'". The error file is CameraDS.obj which is written by directshow. And I checked the producing .obj files with dumpbin /headers, then discovered the header file values of every .obj is machine (x86). Delete these .obj files or just clean solution doesn't work, and the IDE just throws the same error message. I don't konw why.
Is there any solution?
Is it the source of the lib CameraDS.obj?
https://github.com/souseiki/Stereo-Vision
Just recompile it for x64 as well.
Also check that you haven't left x86 anywhere, look at the answers of fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

Module machine type and target machine type Visual Studio 2013

I am running a project with platform WIN32 but my laptop is 64bit. So if I choose the target machine type x64 it will announce :
error LNK1112: module machine type 'X86' conflicts with target machine 'x64' File opencv_ts300.lib
Then when I change the target machine type X86 it will announce
error LNK1112: module machine type 'x64' conflicts with target machine 'X86' File Assemblyinfo.obj.
So what should I do? Please help me. Thank you
Your solution configuration isn't correct. Looks like you mismatched builds in VS "Configuration Manager". Also, it looks like your opencv_ts300.lib is built for x64, so if you don't have x86 built of opencv then you'll have to switch all your projects to x64 as well.
You can't use inline assembly in Visual Studio x64 mode. The assemblyfile.obj is most likely written for x64 anf can't be linked to a x86-compiled c program thereby, causing the second error.

Qt module error - LNK 1112 in QtOpenGL

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
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?
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.

Qt add-in 1.2.4 visual studio 2013 bug

enter image description herePC
qt-opensource-windows-x86-msvc2013-5.5.1 and the 64bit version of it
visual studio 2013 ultimate
qt add-in 1.2.4
windows 10 x64bit
problem:
when i create a qt project in vs and try to build it.
1- i get the error Qt5Widgetsd.lib(Qt5Widgetsd.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
note: the installed version of qt is the 64bit
2- the libraries and everything qt related isn't recognized in the IDE "uderlined red"
things i did to try and solve this problem
when i change the TARGET MACHINE to MachineX64 (/MACHINE:X64) instead of MachineX86 (/MACHINE:X86) (in project properties>linker>advanced) and the platform still as it was (win32)
vs recognize the qt things/libraries and the underlines goes, however when i build i get this error
Debug\moc_shitstackoverflow.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
when i change platform to x64
i get this error
the following error occurred: there's no qt version assigned to this project for platform x64. please use the "change QT version" feature and choose avalid qt version for this platform
and every thing get underlined again
so on an another failed attempt i uninstalled the 64bit of qt version and installed the 32bit one.
when i tried to build a newly created project in vs (under the 32bit) the project succeeded in building, however everything qt related was underlined red and the IDE don't recognizes it.
note* running vcvarsall.bat through qt cmd didn't change the underlining issue in vs in any of those cases!
so please i need help to this problem.
i tried everything i have found on the internet, but nothing solved the problem
so i wrote this very detailed explanation of what i have gone through the past 48 hours!
thanks in advance

msvcprtd.lib(MSVCP100D.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

I created a vs 2010 win 32 program (Operation system: Win 8-64bit)
Then, I tried to convert this win32 program in to x64 by doing like this:
Configuration Manager -> new solution platform (select x64) -> copy settings from win32
The vs2010 created a new x64 program based on the previous win32 program.
However, when I tried to compile and run the x64 program, there is a single error:
msvcprtd.lib(MSVCP100D.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
By renaming both win32 version and x64 version of msvcprtd.lib, I found the program is still using the win32 msvcprtd.lib.
I checked and found msvcprtd.lib is in $(VCInstallDir)lib\amd64. Moreover:
Library Directories -> Inherited values has included all the necessary directories (I think):
$(VCInstallDir)lib\amd64
$(VCInstallDir)atlmfc\lib\amd64
$(WindowsSdkDir)lib\x64
I also checked the 3rd party libraries and dlls the program is using are of x64 version.
My question is why the program is still using the win32 msvcprtd.lib and how to solve this problem?
In the project Library Directories, be sure you change
$(VCInstallDir)lib and $(VCInstallDir)atlmfc\lib
to
$(VCInstallDir)lib\amd64 and $(VCInstallDir)atlmfc\lib\amd64
After searching I came across an useful page MSDN Info. "It is a known problem that on occasions VC picks up certain settings from older versions of VC installed and causes these kinds of problems."
For me it worked by adding the following:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64
Anyway, don't hesitate to search the msvcprtd.lib file directly from Visual Studio installation directory.
I have faced same problem.It comes rarely and occasionally when we create new project for X64 platform.
Here is the solution: for X64 platform
In Configuration properties-->
1.Include directories -> $(VCInstallDir)PlatformSDK\include;$(IncludePath);
2.Library directories -> $(VCInstallDir)PlatformSDK\lib;$(LibraryPath);