您的位置:首页 > 其它

wxWidgets Tips: 用 Visual Studio 编译 wxWidgets 的 64 位版本

2015-09-19 21:17 399 查看
用 Visual Studio 2015(通过 nmake)编译 wxWidgets 动态链接库的时候,出现以下错误:

C:\Lib\wxWidgets\v3.0.2\build\msw>nmake /f makefile.vc BUILD=release SHARED=1 TARGET_CPU=X64

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

link /DLL /NOLOGO /OUT:..\..\lib\vc_x64_dll\wxbase30u_vc_custom.dll  /DEBUG /pdb:"..\..\lib\vc_x64_dll\wxbase30u_vc_custom.pdb" /opt:ref /opt:icf  /MACHINE:X64 /LIBPATH:..\..\lib\vc_x64_dll   @C:\Users\xinyp\AppData\Local\Temp\nm4E86.tmp
vc_mswudll_x64\basedll_dummy.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
NMAKE : fatal error U1077: 'D:\Apps\x86\Microsoft\Visual_Studio\v14.0\VC\BIN\link.EXE' : return code '0x458'
Stop.

C:\Lib\wxWidgets\v3.0.2\build\msw>


解决办法:

如果 Visual Studio 在安装的时候装了 64 位编译支持包,那么在 Visual Studio Tools 里面就会有 64 位版本的 Command Prompt。

以 Visual Studio 2015 为例,我们打开 VS2015 x64 Native Tools Command Prompt,再来执行 nmake 编译命令,就能编译 64 位版本:



参考:

- #15506: nmake base link error with TARGET_CPU=X64, VS2012
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  visual studio wxWidgets