[VS2010] 编译64位静态库lib提示fatal error LNK1112: module machine type 'x64' conflicts等错误的解决方案
2018-01-17 19:40
1096 查看
环境
Win7 x64Visual Studio 2010
程序写完,本想导出dll(x64)、lib (x64),在动态链接库dll下编译成功。
但是在编译静态库lib时,出错了
报错如下:
1>—— Build started: Project: EditAlgoTestFrameWork, Configuration: Release x64 ——
1>Build started 1/17/2018 11:32:37 AM.
1>InitializeBuildStatus:
1> Creating “x64\Release\EditAlgoTestFrameWork.unsuccessfulbuild” because “AlwaysCreate” was specified.
1>ClCompile:
1> All outputs are up-to-date.
1>ResourceCompile:
1> All outputs are up-to-date.
1>Lib:
1> All outputs are up-to-date.
1>LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
1>x64\Release\Test.obj : fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.20
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
原因
由于项目默认 /MACHINE属性值为X86,故在编译lib(x64)时,需要显式指定其值为X64解决方案
项目右键属性(Properties) –> 配置属性(Configuration Properties) –> 库管理器(Librarian) –> 命令行(Command Line) –> 其他选项(additional Options) 指定/MACHINE值为X64:/MACHINE:X64
保存并重新编译即可通过。
相关文章推荐
- 关于使用VS2015编译项目时出现LNK1112 module machine type 'x64' conflicts with target machine type 'X86'
- fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
- VS配制X64驱动:fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
- tal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
- coredll.lib(COREDLL.dll) : fatal error LNK1112: module machine type 'THUMB' conflicts with target machine type 'ARM'
- coredll.lib(COREDLL.dll) : fatal error LNK1112: module machine type 'THUMB' conflicts with target machine type 'ARM'
- fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
- [Qt4]VS2010编译提示error LNK2001: unresolved external symbol "public: virtual struct QMetaObject等错误解决方案
- vs2013链接问题:module machine type 'x64' conflicts with target machine type 'X86'
- fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
- Module Machine Type 'x64' Conflicts With Target Machine Type
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
- 错误提示是因为没有引入javax.servlet.http.HttpServletRequest所在的包,编译错误。 项目–>右键–>properties–>Java build bath–>Lib
- Eclipse Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer 解决方案
- vc++ 使用64位平台编译,运行程序出现0xc000007b错误的解决方案
- 关于在64位win7下运行Virtualbox安装系统时出错(提示VBoxDD.DLL错误)的解决方案
- Error_9_fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
- libjingle mac 编译错误 解决方案 (..完善中..)
- 安装完firefox之后提示:/var/lib/dbus/machine-id找不到的解决方案
- 【编译错误解决方案】提示:“make mrproper”