Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 760
Jim Von Avatar asked Apr 25 '13 13:04

Jim Von


2 Answers

In the project Library Directories, be sure you change

$(VCInstallDir)lib and $(VCInstallDir)atlmfc\lib

to

$(VCInstallDir)lib\amd64 and $(VCInstallDir)atlmfc\lib\amd64

like image 174
Peter Akemann Avatar answered Oct 22 '22 02:10

Peter Akemann


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

like image 2
Sunil D S Avatar answered Oct 22 '22 00:10

Sunil D S