[galib] GCC 3.4.3 + GALib

Peter Jay Salzman p at dirac.org
Wed Feb 20 11:08:56 EST 2008


On Wed 20 Feb 08,  2:03 PM, Steven Bilton <swb04 at doc.ic.ac.uk> said:
> Hi,
> 
> Having endless problems getting GCC 3.4.3 to compile GALib, although it 
> compiled in VS with no issues. Setting it to permissive removed a large 
> chunk of these to make it actually workable, but there's still a vast 
> array of errors, such as:
> 
> ./ga/garandom.h:80: error: syntax error before '=' token
> ./ga/garandom.h:93: error: redefinition of 'GARandomInt'
> ...
> ./ga/GA1DArrayGenome.h:41: error: storage class specified for parameter 
> `SwapMutator'
> ./ga/GA1DArrayGenome.h:42: error: syntax error before '&' token
> ...
> And many more.
> 
> As it says in the docs it should compile out the box with 2.4.7 on GCC, 
> I'm wondering whether I've got some bad flags set. I changed gaconfig.h 
> ever so slightly so it recognised my compiler, so it looks like
> 
> #elif defined(__GNUG__) || defined(__GNUC__) // <-- GNUC was added
> #define GALIB_USE_RTTI
> #define GALIB_USE_BORLAND_INST
> #define GALIB_USE_STREAMS
> #define GALIB_USE_PID
> #define GALIB_USE_EMPTY_TEMPLATES
> #define GALIB_NEED_INSTANTIATION_PREFIX
> #if __GNUC__ > 2
> #define GALIB_USE_ANSI_HEADERS
> #define GALIB_USE_STD_NAMESPACE
> #define GALIB_USE_COMP_OPERATOR_TEMPLATES
> #endif
> 
> Is this likely to be an issue with these ifdefs, and if so has anybody 
> any pointers as to what?
> 
> Cheers
> Steve

Hi Steve,

Sorry to hear about your woes.  I don't have a fix for you, unfortunately,
but perhaps an idea.  You may be able to glean some information by looking
at the output of the preprocessor, which gets emitted to the compiler.  That
might give you a hint about what is defined (and what ought to be defined).

The gcc option for that, IIRC, is "-E".

Pete

-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
Last night I dreamt of 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0

"A mathematician is a machine for converting coffee    p at dirac.org
 into theorems."     -- Paul Erdös                     http://www.dirac.org



More information about the galib mailing list