VC9: LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
来源:互联网 发布:mysql统计每小时记录 编辑:程序博客网 时间:2024/05/29 02:10
当把32位程序改成X64的配置编译后,可能会出现错误:
fatal error LNK1112: module machine type'x64' conflicts with target machine type'X86'
通常是因为某些编译单元被编译成了X86的机器码,进一步的原因是编译选项中缺少
/MACHINE,默认会选择X86;在属性中的link面板中加入/MACHINE:X64
即可。
The error is explicit, you are trying to link libraries that were compiled with different CPU targets. An executable image can only contain pure x86 (32-bit) or pure x64 (64-bit) code. Mixing is not possible.
You change the target CPU by creating a new configuration for the project, only changing the linker setting isn't enough. Build + Configuration Manager, Active solution platform combo on upper right, choose New and select x64. That creates a new configuration with several modified project settings, most importantly the compiler that will be used.
Beware that prior to VS2010, the 64-bit compilers are not installed by default. If you don't see x64 in the platform combo then you'll need to re-run setup.exe and turn on the option to install the 64-bit compilers. Then also re-run any service pack installer you may have applied.
A possible approach with less pain points is to use the 32-bit version of the library.
bumped into this too and found a solution.
First on how I got into this problem. I have a project which builds in x86. Then I use the Configuration Manager to add x64, and I hit this problem.
By looking at BuildLog.htm carefully, I see both of these listed as linker options: /MACHINE:X64
/machine:X86
I can't find any where in the Property Pages dialog where I can change this, so I open up the .vcproj file and look for the appropriate line and change it to: AdditionalOptions=" /STACK:10000000 /machine:x64 /debug"
- VC9: LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
- LINK : warning LNK4068: /MACHINE not specified; defaulting to IX86
- warning : WINVER not defined. Defaulting to 0x0600(Windows Vista)
- warning : WINVER not defined. Defaulting to 0x0600(Windows Vista)
- warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for re
- warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for re
- warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=l
- ofbiz ant启动时 warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; se...
- ant 执行javac时,提示warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set
- 在x86-64位机器上不用gcc直接ld:ld: warning: cannot find entry symbol _start; defaulting to 00000000004002c8
- ld: warning: -macosx_version_min not specified
- Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multi
- WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
- _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h
- _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h
- _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
- _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
- WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
- eclipse 快捷键
- bfs红与黑
- win7 打开plsql登录不上显示空白提示框解决办法
- Cheat Sheet
- 如何创建*.properties文件
- VC9: LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
- Flex使用Repeater创建checkbox组
- 【zacobin原创】IAR平台下开发Renesas单片机-----IAR开发平台搭建
- vi同时查看多个源文件的方法
- dfs:Tempter of the Bone
- 纯虚函数
- Sqlserver2005在安装过程中,提示“ [Microsoft][SQL Native Client]客户端不支持加密”解决办法
- qt如何在vista和windows7下实现Aero效果
- FTP批量下载文件到SAP服务器