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

Jim*_*Von 5 c++ windows 64-bit visual-studio-2010

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
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

I also checked the 3rd party libraries and dlls the program is using are of x64 version.

我的问题是为什么程序还在使用win32 msvcprtd.lib 以及如何解决这个问题?

小智 5

在项目库目录中,一定要更改

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

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


小智 2

经过搜索,我发现了一个有用的页面MSDN Info“这是一个已知问题,有时 VC 会从安装的旧版本 VC 中获取某些设置并导致此类问题。”