Modifying Setup.h for Further Customizations

team bbl


Modifying Setup.h for Further Customizations

If you want to further customize your wxWidgets library by enabling or disabling certain features, all of the configuration options are centralized into a file called setup.h. A separate setup.h file is automatically created from the default setup.h file for each library build and is placed in the lib directory of that build. The exact subdirectory depends on the compiler. For compilers using configure and make, setup.h is in lib/wx/include/<configname>/wx from the build directory. For other compilers, setup.h is in lib/<compiler>_lib/ <configname>/wx.

setup.h mostly contains a long list of wxUSE_... defines. For example, #define wxUSE_THREADS 1 indicates to build the library with support for threads using the wxTHRead class. If you change the 1 to a 0, wxTHRead will no longer be compiled into the library, and you will be unable to build programs that use wxTHRead. By enabling only the features that you need, you can build your own smaller, customized library. Most features are enabled by default, but some specialized features, such as ODBC, must be enabled if you want to use them. The setup.h file is heavily commented, pointing out possible side effects of enabling or disabling certain key features. Note that a change to setup.h requires recompiling the entire library because setup.h is at the very top of the wxWidgets include chain. On Windows, you may also need to pass extra options to the command line, such as USE_OPENGL=1 or USE_ODBC=1.

On Windows, there is a common setup.h in include/wx/msw that is copied, the first time the library is built, to the library configuration's build directory. Changing the setup.h in include/wx/msw will result in changes for all configurations, whereas changing the setup.h in the lib/XX_lib directory will only change that one configuration. This does not apply if you are using configure and make under MinGW/MSYS, which creates the setup.h file as part of the configure process.

    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