Printer-friendly version
warning: Creating default object from empty value in /var/www/drupal/6.x/drupal-6.26/modules/taxonomy/ on line 33.

HOWTO Sneak GCC Switches Past Libtool

When you build a package whose build system relies on libtool, it could be a problem to specify GCC command-line options that libtool does not understand. A frequent case in point is that you want to specify -static-libgcc or -static-libstdc++, to avoid run-time dependencies on libgcc or libstdc++ DLLs.

The problem here is that libtool will not pass to GCC any switches it does not explicitly understand and support. So, for example, specifying LDFLAGS='-static-libgcc' during the configure step will not work: libtool will not pass that switch to GCC.

Exporting a class from a DLL for multiple instantiations

Implementing a class in a DLL allows for exchanging a component of a system without affecting the remainder of it. Exporting a class from a DLL using an abstract interface has been variously documented, but multiple instantiations using that setup have not. Widely referenced is Alex Blekhman's article at the Code project ( While this works well for single instantiations, it does not work at all for various compilers, including MinGW's C++ compiler, when multiple instances are needed.

Bootstrapping GLIB with MinGW


There is a circular dependency between GLIB and the pkg_config packages. In order to overcome the lack of the dependencies you must do a bootstrap method. This requires some basic knowledge of how to overcome the requirement of pkg_config within the GLIB configure process by telling the configure script where to find some things that pkg_config would have given it.

Install MinGW

For instructions on how to quickly download and install MinGW (including GCC compilers for C, C++, Fortran, Java, and Ada, binutils, Windows API, runtime, and make), please refer to the instructions for Getting Started with MinGW. For more detailed instructions, read HOWTO Install the MinGW GCC Compiler Suite.

This wiki is not a forum for discussion of usage issues. Please use the list instead. We do not allow creation of comments by anonymous or untrusted users, on any page.
Site Status

Site maintenance performed successfully, site online Dec 13th 12:00 AM Eastern.