Tuesday, January 02, 2007

Modified wxWidgets Project Wizard of Code::Blocks

wxWidgets (http://www.wxwidgets.org) is a Cross-platform GUI Toolkit in C++. It is very similar to MFC. It supports several compilers in different platforms. Also wxWidgets can be compiled in different builds, e.g. Static, Dynamic, Unicode, Monolithic, etc. Beginners often finds it difficult to compile their first application properly.

Code::Blocks (http://www.codeblocks.org) is a Free, cross-platform IDE written in wxWidgets. The best part of this IDE is that it supports a host of compilers in defferent platforms. It runs in Windows and Linux. The look-and-feel and the power remains same. If you're coding C, C++ and never tried this, I would recommend this to try.

The wxWidgets project wizard of Code::Blocks works well with GCC and MSVC 6, but only Unicode Monolithic build of wxWidgets. The MSVC 8 support was lacking. I started this work as I could not compile my application with Code::Blocks properly with MSVC 8. The existing code has been heavily modified and a lot of new features have been added to the wizard.

New Features:
  • Option to select wxWidgets 2.6.3 or wxWidgets 2.8.0 version libraries (See screenshot below).

  • Supports static, dynamic, ANSI, Unicode, Monolithic builds of both versions of wxWidgets.

  • Option to add additional libraries of wxWidgets if the user is not working with Monolithic build (See screenshot below).

  • Added support to MSVC 8 and Borland C++ 5.5.1 compilers.

  • Additional compiler flags have been added for MSVC 8. Checks are in place to ensure that they don't come up with MSVC 6 or 7.1

  • Debug target now generates Win32 GUI app instead of Console mode app. It also links against Debug build of wxWidgets.
Changes in Revision 1:
  • All the modifications are now restricted to Windows only. Linux or Mac users shall not be affected by Script runtime errors.

  • Wizard now checks for appropriate lib file for Monolithic build and wxbase lib file for non-monolithic builds. Check for setup.h has been removed.

  • Deprecated compier option /Og has been removed from MSVC 8.

  • $(#wx)/include dir is now added as Resource compiler include dir.

  • Richtext library can't be selected if user selects wxWidgets 2.6.3.
Changes in Rev 2 & 2.1:
  • Wizard is now more clean. Adds minimum of numbers of libraries to the project depending upon user's choice.

  • No Win32 libs are added if DLL build of wx lib is selected. Huge thanks to TDragon for pointing that and Mandrav for explaining the reason.

  • MSVC 8 now support wx lib dynamically linked with C Runtime Library (CRT) for all build configurations of wxWidgets. Statically linked wx lib (for MSVC 8 ) are NOT supported anymore.

  • Wizard now generates commands to embed manifest file to generated exe file after linking to load CRT properly during runtime (For MSVC 8 only). So no performance issues with wxString now. But your application will now depend upon msvcrt.dll

  • Options to select almost all the individual libs of wxWidgets in non-monolithic mode. (See the following screenshots).

  • Prepend to Project Options Policy has been added to linker.







Wizard has been tested with:
  • wxWidgets compiled with GCC (MinGW Build) as Release-Dynamic-Monolithic-Unicode build.

  • wxWidgets compiled with Borland C++ 5.5.1 as Debug, Release, Static, Dynamic build

  • wxWidgets compiled with MSVC 8 as Debug, Release, Static, Dynamic and Unicode build. Dynamic linking of C Runtime Libraries have been used.

Known issues:
  • Use the debugging libraries option has been disabled for Windows. The option shall work with Linux.
The code has not been officially added to Code::Blocks distribution. As the code may still not be bug-free, an user testing and discussion is in progress in Code::Blocks forum. It can be reached with the following url.

http://forums.codeblocks.org/index.php?topic=4768.0

The code and installation details are posted at the forum. Please visit the forum for more details. I would also request you to use the code and post your valuable feedback.

Now Happy Coding with wxWidgets + Code::Blocks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 2.5 License. -->

No comments: