wxWidget在vs2005环境下下载,安装,编译

来源:互联网 发布:sai绘画软件下载官方 编辑:程序博客网 时间:2024/06/05 10:53

1.       什么是wxWidgets

wxWidgets lets developers create applications for Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more using one codebase. It can be used from languages such as C++, Python, Perl, and C#/.NET. Unlike other cross-platform toolkits, wxWidgets applications look and feel native. This is because wxWidgets uses the platform's own native controls rather than emulating them. It's also extensive, free, open-source, and mature. Why not give it a try, like many others have?

      

2.       Visual Studio 2005wxWidgets的下载、安装与配置

a)        下载:http://wxwidgets.org/downloads/下载wxMSW版本的wxWidgets,下载下来的应该是一个exe的安装文件。

b)        安装:运行下载下来的安装文件,安装在D:/wxWidgets-2.8.0目录中。

c)         编译Debug版本的库:Visual Studio 2005打开build/msw/wx.dsw文件,Solution Configurations中选中Unicode Debug,直接Build Solution就可以编译出Debug版本的wxWidgets库了。

d)        编译Relase版本的库:Release版本的wxWidgets库虽然也可以通过类似的方法去编译,但编译出来的库仍然依赖于visual studio 2005的运行时库。Debug版本的库依赖VS2005也就算了,反正是自己调试用的。Release版本可是要给别人用的,再带上一大堆dll就不好了。为了解决这个问题,我们需要先在Solution Configuration中选中Unicode Release,然后在Solution Explorer中,针对每一个project在项目属性的C/C++ --> Code Generation --> Runtime Library中选Multi-Threaded(HOHO, 20个项目要改属性啊~~~)。最后再Build Solution就可以了。

 

关于不同的Runtime Library的信息,可参见:

http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=%22C+Run-Time+Libraries%22+site%3Amsdn.microsoft.com

 

e)         Visual Studio 2005的配置:

打开Tools --> Options --> Projects and Solutions --> VC++ Directories

                        i.        Include files中加入D:/wxWidgets-2.8.0/include

                      ii.        Library files中加入D:/wxWidgets-2.8.0/lib/vc_lib

 

f)         基于wxWidgets的项目的配置:

打开项目属性

                        i.        Debug版本的配置:

C/C++ --> General --> Additional Include Directories中写入:D:/wxWidgets-2.8.0/lib/vc_lib/mswud


C/C++ --> Code Generation --> Runtime Library
Multi-Threaded Debug DLL


Linker --> Input --> Additional Dependencies
写入:wxmsw28ud_core.lib wxbase28ud.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib


Linker --> Input --> Ignore Specific Library
写入:LIBCMTD.lib

 

                      ii.        Release版本的配置:

C/C++ --> General --> Additional Include Directories中写入:D:/wxWidgets-2.8.0/lib/vc_lib/mswu


C/C++ --> Code Generation --> Runtime Library
Multi-threaded


Linker --> Input --> Additional Dependencies
写入:wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib

原创粉丝点击