Creating a DevPak for wxDev-C++

Malcolm Nealon

This is going to tell you how to make your own DevPak for replacing the 2.5.4 devpak included in the 6.7 distribution of wxDevCpp, with a 2.5.5 (or 2.6.0, 2.6.1, CVS ... ) version. This method is of course a simple way to maintain a cvs head version of the devpak

Firstly, you need to download the wxWidgets sources. These are currently [url]http://biolpc22.york.ac.uk/pub/[/url or search for them on the downloads page of wxWidgets

I generally choose the cvs distribution (in this case wx-cvs-Msw-setup.exe) which resides in the CVS_HEAD folder, download it and then install. I will proceed under the assumption that you have installed the wxWidgets source code into the c:\wxWidgets folder. You can choose any folder name you desire, this is just for simplicity in the tutorial. It is also sensible to download one of the help files (assuming that it isn't a part of your wxWidgets distribution - it is not a part of the CVS distribution). I would suggest placing the contents of your help file in wxWidgets\docs\htmlhelp assuming that you have downloaded the htmlhelp file (well worth doing).

In the c:\wxWidgets\Include\wx\msw directory, I open the file setup.h and control that everything is as I want it (which basically means don't touch anything), close the file (saving any changes you made), and then copy this file up one level to c:\wxWidgets\Include\wx. So we now have a file c:\wxWidgets\Include\wx\setup.h.

Now we need to create a batch file (.bat). I use Notepad to accomplish this, and here are my contents to wxBaseLib.bat

set WXWIN=c:\wxWidgets path=c:\Dev-Cpp\bin;%path%

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 USE_OPENGL=1 RUNTIME_LIBS=static USE_RTTI=0 USE_EXCEPTIONS=1

pause

This file will build the base wxWidgets Distribution. Other libraries which are a part of the Contrib branch won't be created.

The two batch files should be saved in the folder wxWidgets\Build\msw folder. The batch files are really simple, and should need no real explanation, other than to say that the path value now obviously includes the bin directory of your wxDevCpp directory.

The first two lines need to be changed to reflect where you installed wxWidgets source and where you installed wxDevCpp, the pause is just there so you can see the output once the compilation is complete.

Double click on the batch file wxBaseLib.bat, and then go and make yourself a cup of coffee, while the compilation of your new library is progressing. If you want to create the Contrib libraries, then after wxBaseLib.bat has completed, double click wxContribLib.bat, and go have another coffee.

All things being equal, after (not such) a short time you should be ready. Of course if it doesn't work because the cvs head doesn't compile correctly, then consider finding the solution to that as homework.

Once the compilation is completed, you have one of two options (three if you consider giving up and getting drunk as an option) to choose from.

Option 1

: copy the created libraries and necessary include files into your wxDevCpp distribution

Copy the contents of the wxWidgets\Include map to your wxDevCpp\Include directory. If you have built the Contrib libraries then repeat with the contents of your wxWidgets\contrib\include directory.

Copy the contents of the wxWidgets\lib\gcc_lib to your wxDevCpp\lib directory.

All things being equal (and they very rarely are) then wxDevCpp should now be in a position to use your newly created libraries.

You might want to copy the contents of wxWidgets\docs\htmlhelp to wxDevCpp\help, and then see where other interesting directories should go (art, locale).

Option 2

: create your own devpak

Another tutorial about this is available: http://michel.weinachter.free.fr/DevPack_howto.html

Creating a DevPak is reasonably straightforward, but I did get annoyed making my own for a very simple reason, not all tar programs are created equally. So without further ado, I suggest you download PackMaker from http://sourceforge.net/project/showfiles.php?group_id=10639&package_id=146170&release_id=310363 or search on the DevCpp resources for it. You install it just as you would any other DevPak.

Once installed, from Explorer, go to your wxDevCpp directory, double click on PackMaker.exe.

You are asked if you want to "create a new package" or "open an existing package". Go for a new one.

In the screen presented give your devpak a name (wxWidgets-2.6.1 sounds cool) and save it in your wxWidgets root map.

The next screen is the front page of your DevPak package. Fill in some values to make it look a little more sensible.

Setup Info

name: wxWidgets

name and version: wxWidgets version 2.6.1

version: 2.6.1

Optional Info

Description: Base wxWidgets distribution

URL: http://www.wxwidgets.org

ReadMe file: Browse to the readme.txt file in the wxWidgets\docs folder, and accept this. It makes sense to me.

License file: Browse to the license.txt file in the wxWidgets\docs folder.

Note that these files may be in a different folder in your distribution.

Ignore the rest.

Start menu Icons

Not interested.

Files/Directories to install

Click on Add Directory, the following dialog appears:

Click on the Source: Browse button and browse to wxWidgets\include and click on OK

for destination add \include\ (don't forget the trailing \)

Click on OK

Click on Add Directory, click on the Source: Browse button and browse to wxWidgets\docs\htmlhelp, click on OK.

For the destination add \help\ (don't forget the trailing \ )

Click on OK. Next we add the libraries. Click on Add Directory, for Source, use the browse button and browse to wxWidgets\lib\gcc_lib click on OK. For the destination add \lib\ (don't forget the trailing \ )

Click on OK. Should you want to include the art folder, then click on Add Directory, for Source, use the browse button and browse to art click on OK. For destination I suggest \wx\art\ (don't forget the trailing \)

Click on OK. Click on Add Directory, for Source, use the browse button and browse to locale click on OK. for destination \wx\locale\ (don't forget the trailing \ )

Click on OK. Once ready, save the file (click on the yellow disk - or for the colour impaired - the left one) and then click on the "Build Package" toolbar button (the one to the left of the smiley)

All things being well, it should build a devpak for you.

and you should receive this welcoming dialog.

Now using the Package manager from wxDevCpp uninstall the wxWidgets 2.5.4 devpak, and install your new shiney version.

Sit back and enjoy your work.

Option 3:

Mine's a Southern Comfort, straight up, don't poison me with ice.