howto

Printer-friendly version

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 (http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL). 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

Reason:

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.

Site Status

Site maintenance completed May 25th, 2012 at 12:38 UTC