wxWidgets and Visual C++ Express

If you are interested in using the new Visual c++ Express 2005 to compile wxWidgets applications then this is the blog to read. Here are my instructions how to get started using wxWidgets with the VC8.

There are many advantages to using the new Visual C++ Express 2005. The biggest being that Visual C++ Express 2005 is free if you download it before November of 2006.
Download and install the tools needed

Setup Visual Studio as advised by Microsoft

Tweak your setup for wxWidgets
Next you will want to tweak Visual C++ for wxWidgets.

Note: The following tweaks are not necessary for wxWidgets version 2.6.3 rc1 or newer.

Add the following line to C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults\corewin_express.vsprops before the closing tag:
[xml]
PreprocessorDefinitions=”_CRT_SECURE_NO_DEPRECATE;
_CRT_NONSTDC_NO_DEPRECATE”/>[/xml]

Detailed information on these tweaks may be found here and here.

Compile wxWidgets libraries

  1. Open the wxWidgets VC6 workspace in VC8 (build\msw\wx.dsw) and click yes to convert all classes.
  2. Close the workspace.
  3. Open the newly converted Solution (build\msw\wx.sln). Solution is now the name for a workspace.
  4. From the pull down menu select ‘Build’->Batch Build…’.
  5. Click the ‘Configure’ column. The projects should now be ordered by build type.
  6. Scroll to the build types you want and place a checkbox for each project. I use the static libs that are not unicode, ‘Release’ and ‘Debug’ respectively.
  7. Click ‘Build’.
  8. Go get something to drink, check your E-mail or play a game of Minesweeper.
  9. If successful, you should see: ========== Build: 36 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Converting wxWidgets Samples
I have found that converting the project file (dsp) is easier than converting the workspace file (dsw). To do this, simply click ‘open’ from VC8 and browse to the samples\[project name]\[/project name].dsp and open it. Click yes to convert project to a new Solution.

Before compiling, I recommend saving and closing the converted solution so changes are saved.

Compiling wxWidgets Samples
You should not have any problems compiling the examples that are packaged with wxWidgets.
Please follow the following instructions if you encounter the linking error noted when compiling examples or your own converted projects.

Linking…
CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:1, language:0×0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

There seems to be some sort of issue with the debug version of the wx manifest file. To fix this, add the following 3 lines above the #include “wx/msw/wx.rc” line in your rc file:

[cpp]#ifdef __WXDEBUG__
#define wxUSE_NO_MANIFEST 1
#endif
#include “wx/msw/wx.rc”
[/cpp]

You should now be able to compile the release/debug versions of your previous Visual C++ 6 projects. Happy coding!

Page last modified on Wednesday, March 22, 2006

Blubrry player!