Building wxWidgets and wxc with Microsoft Visual C++

The advantage of using Visual C++ is that the resulting libraries are smaller and faster than the gnu compiled ones. Furthermore, the debug version provides for automatic detection of memory leaks in the wxWidgets libraries and you get a warning when forgetting to deallocate wxWidgets objects. The drawback is that the configure scripts are not used and you will need to set some options manually.

If you want to use Visual C++ Express Edition, you must install Microsoft Platform SDK before building wxWidgets or wxHaskell.

We use the wxWidgets provided workspace directly:

If you want to use database access and openGL canvas, you must edit $wxwin/include/msw/setup.h's #define wxUSE_* (* is target feature name) from 0 to 1.

After building wxWidgets, you need to run configure for the wxHaskell library.

> cd $wxhaskell
> ./configure --with-msc

If you want to use the debug version of the library, use the --wxc-libname option too.

> ./configure --with-msc --wxc-libname=wxcd

After configuration, first run make command to generate stc_gen.* files.

> make

Make will stop by following error.

> make: *** No rule to make target `out/wxc/wxc-msw2.6.4-0.10.1.dll', needed by `wxc'.  Stop.

Then go $wxhaskell/wxc directory. Here, you need to adapt the wxc-version.dsp project to reference the correct wxWidgets directory. Open the .dsp file in an editor and replace all occurrences of "..\..\wxWindows-2.4.2" (or "..\..\wxWindows-2.6.4") or by the installed wxWidgets directory, i.e. $wxwin.

After adapting the project file, you can open the workspace wxc/wxc-version.dsw and build the release and debug versions of the C wrapper library (if you use wxWidgets 2.6.4, you must choose "Unicode Release" or "Unicode Debug" instead of choosing just "Release" or "Debug").

And finally! – you can run make in the $wxhaskell directory to build the Haskell libraries.

> cd $wxhaskell
> make
> make install
> make wx
> make wx-install
toplast update: "Aug 18 2007".