WxWidgets Build Configurations

From WxWiki
Jump to: navigation, search

All build configurations represent pre-configured settings for building wxWidgets in either ANSI or Unicode mode, Debug or Release, Static or Dynamic libraries, as well as separate configurations for building either wxMSW or wxUniversal. Each one of these will result in different libraries being built in different file locations. Here's a brief explanation of each of these modes:

ANSI or Unicode If building with Unicode support, wxWidgets will use Unicode strings with all components, and will automatically set the type of all literal strings properly wrapped with the string translation functions [_T(""), _(""), wxT("")] as wide character Unicode strings. See the Unicode Overview for more information.
Debug or Release Building in debug mode will result in libraries with debug symbols (useful when using a debugger) as well turn on the functionality of all helpful debugging functions and macros and prompt the user upon reaching assertions. You will almost always have a need for both debug and release configurations. See the Debugging Overview for more information.
Static or Dynamic Unless a configurations is labeled with "DLL", it is a static library configuration. Static libraries are linked directly into your program's executable when compiled while dynamic libraries are released as separate DLL files that your program links to dynamically at runtime. If you are unsure about which to use, build the static libraries.
Universal This is a port of wxWidgets (also referred to as "wxUniversal") which implements the various GUI controls by drawing them itself (using low level wxWidgets classes). It is implemented on most platforms and will result in your program looking identical on all platforms much like using Java or GTK+. Most wxWidgets users use wxWidgets because of its ability to build native looking applications, so this is rarely used, rarely worked on, and only implements a small subset of the wxWidgets library. Do not use Universal configurations unless you know what you are doing. See the docs/univ/readme.txt file for more information.


IDEs

Many IDEs provide a collection of build configurations that can be selected via a combo-box or a similar control (see screenshot).

Build configurations under VC++ 2008

Command Prompt

When using the command prompt to build the wxWidgets library, build setting are passed as parameters or flags. The following is a list of common paramters:

configure flag Makefile parameter Description
--disable-shared SHARED=0 Builds static libraries
SHARED=1 Builds dynamic libraries
--enable-monolithic MONOLITHIC=1 Packages all libraries in a single file. (Note: do not combine this option with a static build.)
--enable-unicode UNICODE=1 Builds wxWidgets with Unicode support. This is the default mode. Disable Unicode only if you really need to! That is not recommended.
--enable-debug BUILD=debug Build the library with debug support.
BUILD=release Release build of the library (with no debug support).


Combinations of the common compile flags

Combination Description
SHARED=0 BUILD=debug Builds static debug libraries.
SHARED=0 BUILD=release Builds static release libararies.
SHARED=1 BUILD=debug Builds dynamic debug libraries.
SHARED=1 BUILD=release Builds dynamic release libraries.
SHARED=1 MONOLITHIC=1 BUILD=debug Builds one big, dynamic debug library.
SHARED=1 MONOLITHIC=1 BUILD=release Builds one big, dynamic release library.

Makefiles

When using makefiles, parameters passed to the make program signify the desired build configuration. For example, the following command will produce a Debug DLL with Unicode support:

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug

configure

Flags passed to the configure script signify the desired build configuration. For example, the following will produce a static library with Unicode support:

./configure --disable-shared --enable-unicode

For a list of all possible configure flags, run ./configure --help.