WX.Net

About/News
Screenshots

Documentation
    Why WX.Net? 
    Roadmap
    Release Notes
    Building From Source
    Tutorial
    User Manual
    Reference Doc.
    WX.Build Doc.
    wxWidgets

Download

Who's Who
SourceForge

Get WX.Net at SourceForge.net. Fast, secure and Free Open Source software downloads

Built with wxWidgets

Works on Mono

?????????????????????????

Building on Windows Using Visual Studio.NET

Introduction

This document provides detailed instructions on how to build wx.NET using Microsoft's Visual Studio.NET (VS.NET) on Windows. Microsoft's .NET runtime is also assumed to be your virtual machine.

In the following instructions WXW_TOP will refer to the top-level wxWidgets source directory. For example, C:\Src\wxw-cvs\wxWidgets.

Download wxWidgets

As of this writing, wx.NET requires version 2.6 of wxWidgets. There are a variety of ways you can build and install wxWidgets. Regardless of which method you use, you must install somewhere without spaces in a folder name.

Building from the 2.6 Snapshot

Download this release from:

http://www.wxwidgets.org/dl_msw2.htm#dev

Both the wxMSW-2.6.x-setup.zip and wxMSW-2.6.x.zip files ultimately install the same exact files. The setup file simply has a fancy installer front end.

Download a Nightly CVS Snapshot

If you know of a bug that is resolved in CVS, using a snapshot of CVS is probably the easiest approach to take. The source tarball is available at:

http://wxwindows.sourceforge.net/snapshots/

Building from CVS

If you want to always stay on top of the latest wxWidgets changes, you will probably want to use a CVS client to synchronize your wxWidgets source to CVS.

If you have Cygwin installed, use the following command to check out the latest CVS source:

$ cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwindows \
  co wxWidgets

Use the password "anoncvs".

WinCVS is a free GUI oriented CVS client that could be used as well. WinCVS can be downloaded at http://www.wincvs.org/.

Configure wxWidgets

Building wxWidgets works very differently under Windows than it does on Linux/Mac, because many developers do not have the standard UN*X oriented build tools.

While you should be able to build using the VS.NET IDE, it is problematic because CVS (I think??) converts Windows CR/LF to UN*X newlines only. And unfortunately VS.NET is so brain dead that it can not read these files. While Cygwin's unix2dos tool can fix this, I'll stick to documenting the command-line build mode.

Your first major step is to create a setup.h file. On Linux/Mac this gets created by the configure process. On Windows you edit this by hand. Browse to the folder WXW_TOP/include/wx/msw and copy setup0.h to setup.h. Then edit this file and:

  • Change wxUSE_DISPLAY to 1
  • Change wxDIALOG_UNIT_COMPATIBILITY to 0
  • Ensure WXWIN_COMPATIBILITY_2_4 is set to 1

Next edit the file WXW_TOP/build/msw/config.vc and change BUILD from debug to release.

Setup Your VC Build Environment

Launch a Windows shell (cmd.exe) and run the Visual C++ environment variable setup batch script:

"%VS71COMNTOOLS%vsvars32.bat"

You must type/paste the quotes. This script will define various environment variables needed by the Visual C++ compiler and linker. It is assumed you will use this shell when building wxWidgets in the sections that follow.

Build wxWidgets

In the folder WXNET_TOP/Build/Windows/VS.NET, copy the file Defs.in.template to Defs.in. Use your favorite text editor to edit Defs.in. It is pretty self explanatory.

Now from your Windows shell do the following:

cd WXNET_TOP/Build/Windows/VS.NET
nmake wxw

This will build the wxWidgets core libraries and a few contrib libraries. If you would like to build the wxWidgets samples, do the following:

nmake wxw-samples

Please see the samples section for details about the wxWidgets samples.

Configure and Build wx.NET

Inside of the WXNET_TOP/Build/Windows/VS.NET directory copy Defs.in.template to Defs.in. Open Defs.in in an editor. Defs.in is a mini-Makefile that contains a few definitions that drive the build process. You must change the setting for WXW_TOP to point to the top-level directory where your wxWidgets source tree lives.

Next, from your Windows shell:

cd WXNET_TOP/Build/Windows/VS.NET
nmake wxnet

This will create Visual Studio.NET library/sample solution and project files.

Now launch the wx.NET solution file, WXNET_TOP/wx.NET.sln. Set the build type to Release and do a build.

The build process is split into two parts:

  • Creating the wx-c wxWidgets C++ wrapper library, wx-c.dll
  • Creating the wx.NET .NET assembly file, which uses the above, wx.NET.dll

If everything goes well, the above files will be placed in WXNET_TOP/Bin.

Build and Run the wx.NET Samples

Launch WXNET_TOP/Samples/Samples.sln. Set your build type to Release and build. The compiled .exe assemblies will be installed in WXNET_TOP/Bin.

To run the samples, use the Explorer to open the top-level source or install folder. Launch Sample-Launcher.exe. This will start a sample browser using the MS.NET's runtime. Please review the Samples section for a list of any outstanding bugs or issues. You can also launch samples directly from the Bin folder.

Build the Utilities

There is currently one utility provided with wx.NET, ToWxnet. This C# program can be used to convert wxGlade (.wxg) and XML Resource Configuration (XRC) UI layout files to either C# or VB.NET code. To build, launch WXNET_TOP/Utils/Utils.sln.

Last changed on $Date: 2005/07/25 05:15:16 $ by $Author: t9mike $  •  Original Author: Michael S. Muegel