Look at
Silk road rain [recommended]
Winver = 0x400 in the VC pre-treatment definition, is STRICT?
A Tutorial for WxWindows 2 has ZIP and PDF Tutorial Document Downloads on this page
Tutorial and resources:
http://www.bzzt.net/~wxwidgets/icpp_wx1.html
Wyoguide http://wyoguide.sourceforge.net/
http://sourceforge.net/projects/wxwindows
Jabber Clients Development Team http://www.cllrnet.ca/~ahmed1980/wxwindows/wxwindows.htm
A better and concise installation tutorial on this site (for vc) [recommended]:
Compiling WXWindows Applications in The VC IDE:
WXWindows program compile option settings to take the following I will write, I am, because I am destined to become a master of master ~ huh,
First, make sure your WXWindows has been installed and compiles your WXWindows to the corresponding lib and dll files.
Then, add your wxwindows installation directory to the environment variable to look for the header file and link library and and DLL.
For example, your installation directory is C: / Program files / wxwindows242, add a variable in environment variables: wxwin = C: / Program files / wxwindows242
This is set this in XP:
My Computer >> Property >> Advanced tab >> Environment variable, then create a variable in user variables,
Variable name: wxwin
Variable: C: / Program files / wxwindows242
Then, the path to the header file and library file in the VC
Tools >> Options >> Directories tab,
Show Directories for Include Files, then add directory in the Directories column C: / Program Files / WXWindows242 / Include
Show Directories for Library Files, then add directory in the Directories column C: / Program Files / WXWindows242 / LIB
--------------------
Of course, if you are willing
Show Directories for Source Files, then add directory in the Directories column C: / Program Files / WXWindows242 / src
it is also fine.
Then, for each new project, follow the version you need to compile the release Project >> Settings. (Or press Alt F7)
Note that because we use WXWindows, don't need to use MFC, in the following settings, both you want to issue which version, in the Project Settings, in the General tab, NOT USING MFC .
If you want to use wxwindows and MFC hybrid programming, I will tell in another article.
Based on the actual example of online articles and wxwindows (subject to official example), and I personally compile practice, introduce the compilation configuration that needs to be added - this is what you have made the above-mentioned setting environment variable ( Below you will use), including the header file and library file path, then use AppWizard to add a Win32 Application except for the samples directory of the wxwindows installation directory (such as E: / Test) to create an empty Empty Project, adding a main.cpp after setting up, settings.
Note: If you have established a project in the Samples directory below the wxwindows installation directory, then you must set it according to the official example (the example in the sample directory), I tried, Ctrl C, Ctrl V, OK. Compile Version Directory
Release
Debug
Debug Unicode
Debug DLL
Debug Unicode DLL
RELEASE
Release Unicode
Release DLL
Release Unicode DLL
Compiling debug debug version (Win32 debug) << Please read carefully, this written is more detailed, the other compiling version is very similar
General tab
Default ^ _ ^
C / C tab
Selected category (the Category) General drop-down box, the added PreProcessor difinitions: WIN32, _DEBUG, _WINDOWS, WINVER = 0x400, _MT, wxUSE_GUI = 1, __, selected PreProcessor __ WXDEBUG WXDEBUG = 1 classified drop-down box, the Additional include directories Add: $ (wxwin) / lib / mswd Note, because you compile the debug version, and does not use the DLL, and the debug version must contain the debug version of Setup.h, it is located in $ (wxwin) / lib / mswd directory Under WX / Setup.h, although under this WX subdirectory, it is possible to include the MSWD directory. $ (Wxwin) means a variable registered in the user environment variable in front of me, representing C: / Program Files / wxwindows242 directory. Use it, mainly reduce input, each time C: / Program files / wxwindows242 is tired, this is not to be described in the back configuration. Note: This setup.h is released at each release Version is different (mainly in some configuration switches, of course, is the case, I didn't see every setup.h), at different directories, as follows
Release versions setup.h include path (actually in WX / LIB / MSWD Debug Unicode $ (wxwin) / lib / mswdebug DLL $ (wxwin) / lib / mswdddebug uncode DLL $ (wxwin) / lib / mswdlludRelease $ (WXWIN) / lib / mswRelease Unicode $ (WXWIN) / lib / mswuRelease DLL $ (WXWIN) / lib / mswdllRelease Unicode DLL $ (WXWIN) / lib / selected mswdllu Category drop-down box PreCompiled Headers, select Not using Precompiled Headers or Automatic Use of Precompiled Headers (recommended, VC's IDE supports pre-translated header files). As for use precompiled header file (.pch), THROUGH header: $ (wxwin) /include/wx/wx.h, I fell I haven't tried it. You can try it yourself. In addition, some foreign websites don't use create precompiled header file (.pch) option because it may cause Windows crash. (Crash), I have tried it once, I feel that it is not so serious. Select Code Generation in the classification drop-down box, select Debug Multithreaded DLL in Use Run-Time Library (Debug Debug, Release Release with Multithreaded DLL, As for why I want to select (debug) Multithreaded DLL because wxwindows is compiled using multipleReaded DLL) LINK tabs
The original libraries in the classification drop-down box are the original librar in the original libaer32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib Odbc32.lib UUID.LIB ODBC32.LIB Odbccp32.lib, we need to add ComctL32.lib rpcrt4.lib wsock32.lib wxmswd.lib, for the last wxmswd.lib, with the following table Description Distributed WXWINDOWS library (library) debroug wxmswd.lib debug uncodewxmswud. libDebug DLLwxmsw24d.lib (8.3 format, my version is 2.4.2) Debug Unicode DLLwxmsw24ud.lib (8.3 format? I faint, change ~!) release wxmsw.libRelease Unicode wxmswu.libRelease DLLwxmsw24.libRelease Unicode DLLwxmsw24u.lib in addition, If you need to handle an image, you can add pngd.lib jpegd.lib Tiffd.lib (these are debugging, debug version of libs with xxxd.lib's form, the release version of XXX.LIB), if you To use a regular expression, add regexd.lib, use zip features, add zlibd.lib. Processing images, pay attention to the image example in the sample directory. There is also a more important and more advanced, if you use wxwindows dedicated XML Resource file (.xrc file) You must also include wxxrc.lib (this library, you have to compile related projects in the src directory), which is not described in the back configuration. Category Down-down box Select Input, Add libcd.lib resources tab in Ignore Libraries
Add $ (wxwin) / include Director in Additional Resource Include Directories, pay attention to this step is not required, you don't have to set it. But when you need to use the resource file (RC) of XML format in WXWindows specific format, you should pay attention to put $ ( Wxwin) / contrib / incline directory contains
Compile the release (Win32 Release)
General tab
Default ^ _ ^
C / C tab
Categories Downlink box Select General, add: ndebug, win32, _windows, wxuse_gui = 1 Category drop-down box in Preprocessor Difinitions, Add: $ (wxwin) / lib Add: $ (wxwin) / lib / MSW Note, because you compile the release version, and don't use the DLL, and the Release version must contain the Release version of the setup.h, it is wx / setup.h under the $ (wxwin) / lib / msw directory, though In this WX subdirectory, it is possible to include the MSW directory. Category PRECMOMPILED Headers or Automatic Use of Precompilers or Automatic Use of Precompilers or Automatic Use of Precompilers or Automatic Uses. User Run-Time Library Select Multithreaded DLL (Release Request). LINK Tab
The original libraries in the classification drop-down box are the original librar in the original libaer32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib Odbc32.lib UUID.LIB ODBC32.LIB Odbccp32.lib, we need to add ComctL32.lib rpCRT4.LIB WSOCK32.LIB wxmsw.lib, for the last wxmsw.lib, there is an explanation, if you need to process an image, you can add png.lib jpeg.lib Tiff.lib (These are the release of Release use), if you want to use regular expressions, add reged.lib, use zip features, add zlid.lib and a more important and more advanced, if you use wxwindows Dedicated XML resource file (.xrc file) You must also include wxxrc.lib (this library, you have to compile relevant projects in the src directory), which is not described in the back configuration. Category drop-down box Selected INPUT, add libc.lib in Ignore Libraries, pay attention to the debug version, DEBUG ignores the libcd.lib resources tab Add $ (wxwin) / include Director in Additional Resource Include Director, pay attention to this step is not required, you can No setup.
But when you need to use the resource file (RC) of the XML format in wxwindows specific format, you should pay attention to the $ (wxwin) / control / include directory.
Compilation Release DLL version (Win32 Release DLL)
First of all, make sure you put wxmsw24ud.dll wxmsw24.dll wxmsw24u.dll wxmsw24d.dll (in the lib directory) to your Windows / System32 / directory, when you can not run, you can't find XXX The error of .dll.
In addition, it is said that a little gossip, compares the DLL of the MFC (such as MFC42.DLL), the size of these DLLs is several times, and the MFC42.dll is only 900 KB, and the above DLL is 2 ~ 4MB.
You may not know how to compile Win32 Release DLL version because the compiler defaults only Win32 debug version and Win32 Release version. Tell you step: build >> Config >> Pop-up Configurations dialog >> Click Add button >> pop-up Add Project Configuration Dialog >> Enter the Release DLL in Configuration >> Select XXX-Win32 Release in Copy Settings from Copy Settings from (if you are Win32 Debug DLL, you can copy from XXX-Win32 Debug) >> Click OK, success!
General tab
Default ^ _ ^
C / C tab
Classification drop-down boxes Select General, add: ndebug, win32, _windows, wxuse_gui = 1, wxusingdll = 1, wxusingdll = 1, wxusingdll = 1 Category DownloadDLL = 1 Classification drop-down box Select PreProcessor Add: $ () Add: $ 4 in Additional Include Director WXWIN / lib / mswdll Note, because you compile the release version, and use the DLL, and the Release DLL version must contain the Release DLL version of Setup.h, it is located in a $ (wxwin) / lib / mswdll directory WX /Setup.h, although under this WX subdirectory, it is possible. You can use the mswdll directory. Category drop-down box Select Precompiled Headers or Automatic Use of Precompilers or Automatic Use of Precompilers (recommended). Category drop-down box Select Code Generation, select Multithreaded DLL in Use Run-Time Library (this version). Link tab classification drop-down box Selected general, Object / library modules original LIB is kernel32.lib user32.lib GDI32. lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib, we need to add is comctl32.lib rpcrt4.lib wsock32.lib wxmsw24.lib, for the last WXMsw24.lib, which has an explanation input in the classification drop-down box, add libc.lib in Ignore Libraries, pay attention to the Debug version, Debug ignores the libcd.lib resources tab
Add $ (wxwin) / include Directories to Additional Resource Include Directories, pay attention to this step is not required, you can do not set it.
But when you need to use the resource file (RC) of the XML format in wxwindows specific format, you should pay attention to the $ (wxwin) / control / include directory.
Compiling debug debug DLL version (Win32 Debug DLL) and the above similar, NDebug is changed to _debug, the corresponding change contains the lib file.
Compile Release Unicode (Win32 Release Unicode)
General tab
Default ^ _ ^
C / C tab
Select General in the Classification drop-down box, add: ndebug, win32, _windows, wxuse_gui = 1, _mt, wxuse_gui = 1, _mt, wxuse_gui = 1, _mt, wxuse_gui = 1, _mt, wxuse_gui = 1, _UNICOEDE, Add: $ ( Wxwin) / lib / mswu Note, because you compile the release unicode version, and does not use the DLL, and the Release version must contain the Release version of the setup.h, it is located in the $ (wxwin) / lib / mswu directory WX / Setup.h, although in this WX subdirectory, it is possible. You can include the MSWU directory. Sate of the classification drop-down box, select NOT USING Precompilers or Automatic Use of Precompilers or Automatic Use of Precompiled Headers. Code Generation, select Multithreaded DLL in Use Run-Time Library (Release Remoduction). LINK tab
The original libraries in the classification drop-down box are the original librar in the original libaer32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib Odbc32.lib UUID.LIB ODBC32.LIB Odbccp32.lib, we need to add ComctL32.lib rpcrt4.lib wsock32.lib wxmswu.lib, for the last wxmswu.lib, the selected INPUT in the classification drop-down box, add libc.lib in Ignore Libraries, Note that the debug version is compared, Debug ignores the libcd.lib resources tab Add $ (wxwin) / include Director in Additional Resource Include Director, note that this step is not required, you can not set it.
But when you need to use the resource file (RC) of the XML format in wxwindows specific format, you should pay attention to the $ (wxwin) / control / include directory.
Compile Debug Unicode version (Win32 Debug Unicode) and the above similar, NDebug is changed to _debug, and the corresponding change contains the lib file.
Compile Release Unicode DLL version (Win32 Release Unicode DLL)
General tab
Default ^ _ ^
C / C tab
Selected Category drop-down box General, adding PreProcessor difinitions in: NDEBUG, WIN32, _WINDOWS, WINVER = 0x400, _MT, wxUSE_GUI = 1, WXUSINGDLL = 1, _UNICOEDE, UNICODE selected PreProcessor, Category drop-down box in the Additional include directories Add: $ (wxwin) / lib / mswdllu Note, because you compile the Release Unicode version, and use the DLL, and the Release Unicode version must contain the Release Unicode version of Setup.h, it is $ (wxwin) / lib / The WX / Setup.h under the Mswdllu directory, although below this WX subdirectory, but contains the mswdllu directory. Category drop-down box Select Precompiled Headers or Automatic Use of Precompilers or Automatic Use of Precompilers (recommended) Category Code Generation in the Category drop-down box, select Multithreaded DLL in Use Run-Time Library (this version). LINK tab
The original libraries in the classification drop-down box are the original librar in the original libaer32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib Odbc32.lib UUID.LIB ODBC32.LIB Odbccp32.lib, we need to add ComctL32.lib rpCRT4.LIB WSOCK32.LIB wxmsw.lib, for the last wxmsw.lib, there is an explanation, if you need to process an image, you can add png.lib jpeg.lib Tiff.lib (These are the release of Release use), if you want to use regular expressions, add reged.lib, use zip features, add zlid.lib and a more important and more advanced, if you use wxwindows Dedicated XML resource file (.xrc file) You must also include wxxrc.lib (this library, you have to compile relevant projects in the src directory), which is not described in the back configuration. Category drop-down box Selected INPUT, add libc.lib in Ignore Libraries, pay attention to the debug version, DEBUG ignores the libcd.lib resources tab Add $ (wxwin) / include Director in Additional Resource Include Director, pay attention to this step is not required, you can No setup.
But when you need to use the resource file (RC) of the XML format in wxwindows specific format, you should pay attention to the $ (wxwin) / control / include directory.
Compile Debug Unicode DLL version (Win32 Debug Unicode DLL) and the above similar, NDEBUG is changed to _debug, the corresponding change contains the lib file.
However, I have to emphasize that all the Unicode version, joining _unicode and unicode I have not tried it, if I tried, I pointed out the mistake, thank you here.
One point is written on top.
Conclusion: I wish you all good luck, the Year of the Chicken!
Huyoo on April 1, 2005, it seems to be April Fool's Day ~
Contact me, please send an email to huyoo353 {at} 126 {dot} COM