galib is a C++ library for implementing genetic algorithms. This page offers patches that allows better C++ compliance, as required by gcc-3.4, see e.g. the following threads on the galib mailing list reporting these problems: 1, 2, 3


You can download galib-2.4.5-al1.tar.gz here, or you can find the diff patch.

Notes with galib-2.4.5-al1

This adaptation was necessary to compile galib-2.4.5 with gcc-3.4. Since gcc-3.4 requires more compliance with the standard, tighter use of template inheritance and scoping in galib-2.4.5 was required.

Note that this patch is not completely checked, and more problems may turn up upon compilation of specific applications using galib-2.4.5-al1 with gcc-3.4. Disclaimer: I cannot guarantee anything for this patch. Please send your bugs and further patch requests for compliance of galib-2.4.5-al1 with gcc-3.4 to

The following changes were required for getting galib-2.4.5 compiled for gcc-3.4, resulting in galib-2.4.5-al1

        #include <ga/garandom.h>
        using namespace GARandom;

or call these functions from within their GARandom namespace, e.g. use


to access the functions.

Because of the addition of a namespace, I had to drop all random number generators, except for the default ran2() and sran2() functions, which have now been renamed to ran() and sran(). If you need other random functions, you'll have to go back to an older version of galib and patch the function you want into ga/garandom.C

comments powered by Disqus