您的位置:首页 > 其它

wxWidgets Tips: Compile wxWidgets 3.0.2 using Visual Studio 2015

2015-09-19 22:47 671 查看
首先我们要设置环境变量,设置方法见:《wxWidgets Tips: Compile wxWidgets 3.0.2 using Visual Studio 2013 (1)

目前的 wxWidgets 3.0.2 要想用 Visual Studio 2015 编译,还必须打一个官方提供的 patch,见:《wxWidgets Tips: 用 Visual Studio 2015 编译 wxWidgets

然后,如果我们想要编译 64 位版本,还要注意这个问题:《wxWidgets Tips: 用 Visual Studio 编译 wxWidgets 的 64 位版本

然后我们就可以用 Visual Studio 2015 编译 wxWidgets 的各种版本了。编译选项示例如下:

编译 x86 版本

打开 Visual Studio Tools 里面的 VS2015 x86 Native Tools Command Prompt,先执行

cd /d %WXWIN%\build\msw

然后再通过 nmake 按照以下编译选项进行编译:

Versionnmake command
Static libraries x86 Debugnmake /f makefile.vc std=C++11 SHARED=0 BUILD=debug TARGET_CPU=X86 /A
Static libraries x86 Releasenmake /f makefile.vc std=C++11 SHARED=0 BUILD=release TARGET_CPU=X86 /A
Dynamic libraries x86 Debugnmake /f makefile.vc std=C++11 SHARED=1 BUILD=debug TARGET_CPU=X86 /A
Dynamic libraries x86 Releasenmake /f makefile.vc std=C++11 SHARED=1 BUILD=release TARGET_CPU=X86 /A
截屏:



编译 x64 版本

打开 Visual Studio Tools 里面的 VS2015 x64 Native Tools Command Prompt,先执行

cd /d %WXWIN%\build\msw

然后再通过 nmake 按照以下编译选项进行编译:

Versionnmake command
Static libraries x64 Debugnmake /f makefile.vc std=C++11 SHARED=0 BUILD=debug TARGET_CPU=X64 /A
Static libraries x64 Releasenmake /f makefile.vc std=C++11 SHARED=0 BUILD=release TARGET_CPU=X64 /A
Dynamic libraries x64 Debugnmake /f makefile.vc std=C++11 SHARED=1 BUILD=debug TARGET_CPU=X64 /A
Dynamic libraries x64 Releasenmake /f makefile.vc std=C++11 SHARED=1 BUILD=release TARGET_CPU=X64 /A
截屏:



参考文章

wxWiki: Microsoft Visual C++ Guide

wxWiki: WxWidgets Build Configurations

wxWiki: WxWidgets 3.0.x Documents

wxWidgets类库结构图

wxWidgets 的 Linux / Windows 混合开发环境

How to compile a wxWidgets application in Visual Studio 2008?

wxWidgets, C++ libraries and C++11

wxWidgets编译简介

wyoGuide: A guide, a tutorial for developing well-designed cross-platform applications
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  visual studio wxWidgets