Choosing Your Development Tools

team bbl


Before we discuss wxWidgets installation, let's briefly look at choices in compiler tools to use with wxWidgets. Note that although cross-compilation is possible (compiling on one platform to run on another), you will generally need to compile, debug, and test on each platform that you support. However, you probably have a favorite platform you prefer to develop on, just compiling and testing on the others. If you only have one machine for Windows and Linux development, consider using a tool such as the excellent VMware virtual machine software to run several operating systems simultaneously.

Tools on Windows

Microsoft's Visual Studio (see the section "WindowsMicrosoft Visual Studio") has a very good IDE, which makes debugging productive, and the compiler is good at optimizing executables for space and speed. It's also reasonably fast to run (though slower than Borland C++). This compiler is highly recommended for wxWidgets work, and it is the tool of choice for most wxWidgets developers on Windows.

Borland C++ (BC++) is a fast compiler, but the linker has trouble with wxWidgets executable sizes, and the compiler is not actively supported by Borland. In addition, there is no good free debugger for BC++. You can download Borland C++ from http://www.borland.com/products/downloads/download_cbuilder.html.

GCC is available in two forms on Windows: MinGW and Cygwin. MinGW makes use of the Windows run-time libraries and so is a better choice for "native" Windows applications. MinGW has an accompanying Unix-like shell, MSYS, which you will need if you want to use the configure method of compiling. MinGW can also compile wxWidgets and applications from the Windows command prompt using its own make tool and makefile.gcc makefiles. MinGW can be used on its own or with an IDE such as Dev-C++ or DialogBlocks. Download it from http://www.mingw.org or install it from the CD-ROM. Unfortunately, GCC is a slow compiler that creates huge libraries and executables, and its GDB debugger (or IDE equivalents) cannot compare with the convenience of VC++'s debugger.

Digital Mars C++ also works with wxWidgets and is quite fast; the IDE and debugger need to be purchased. Download Digital Mars C++ from http://www.digitalmars.com or copy it from the CD-ROM.

OpenWatcom C++ does not implement all C++ standards, but it works with wxWidgets and can be downloaded from http://www.openwatcom.org or copied from the CD-ROM.

CodeWarrior will also work with wxWidgets and provide a consistent environment for those using CodeWarrior on MacOS.

See also Appendix E, "Third-Party Tools for wxWidgets," for other IDEs and tools.

All the compilers mentioned here can be "driven" by DialogBlocks (on the accompanying CD-ROM), so you can design your dialogs and other user interface elements in addition to building and running your application. See Appendix C for more on DialogBlocks.

Tools on Linux and Mac OS X

On Linux, GCC is usually installed by default. However, you can use it in a number of different ways. You can use command-line tools (configure, make, and GDB for debugging), or you can use an IDE such as KDevelop, as described in this chapter (though you'll still compile the wxWidgets libraries from the command line). You also can use the command line to compile and then use GDB within Emacs to step through your application, or you can use the graphical debugger DDD.

On Mac OS X, you can download the GCC-based development tools from Apple's web site after registering as an Apple Developer Connection (ADC) member. You can use configure and make in exactly the same way as on Linux, but you can also use Apple's Xcode IDE to compile applications, again described later in this chapter. If you prefer, you can use CodeWarrior; however, you may find it harder to automate wxWidgets and application builds with CodeWarrior.

On both Linux and Mac OS X, you can also use DialogBlocks (on the CD-ROM), enabling you to create dialogs and other user interface elements easily in addition to generating makefiles and building your application with GCC. See Appendix C for more on DialogBlocks.

You may want to start off compiling wxWidgets and its samples with the command-line tools and then graduate to an IDE for new applications when you understand the basics.

    team bbl



    Cross-Platform GUI Programming with wxWidgets
    Cross-Platform GUI Programming with wxWidgets
    ISBN: 0131473816
    EAN: 2147483647
    Year: 2005
    Pages: 262

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net