我正在编译一个可视化 C++ 项目,但出现错误:
"1> 2>objd\amd64\BasicFeatures.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' [D:\xproject\xproject.vcxproj]"
我检查了此线程中的所有项目:https ://stackoverflow.com/a/4364020/974101
Project Property -> Configuration Properties -> Linker -> Advanced 中的目标机器是 MachineX64 (/MACHINE:X64)
解决方案属性中的平台 -> 配置管理器是 x64。
但是 BasicFeatures.obj 的目标机器是 x86 使用“dumpbin /headers BasicFeatures.obj | more”:
Dump of file BasicFeatures.obj File Type: COFF OBJECT FILE HEADER VALUES 14C machine (x86) 1439 number of sections 52DC8466 time date stamp Mon Jan 20 10:05:26 2014 230284 file pointer to symbol table 4F2B number of symbols 0 size of optional header 0 characteristics
VC++ 目录中的可执行目录/库目录是
"$(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(SDK40ToolsPath);$(WindowsSdkDir)bin;$(VSInstallDir)Common7\ide;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);" "$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;"
问题是当我的项目针对 x64 时,为什么 BasicFeatures.obj 的目标机器是 x86?以及如何将其更改为 x64?
谢谢。