GALib: Compiling with Sun C++ 4.0.1

Simon Ongeri song at ierm.ed.ac.uk
Thu May 1 11:52:15 EDT 1997


I have been attempting to GALib using Sun C++ 4.0.1 under Solaris 2.4, but I am 
encountering template instantiation problems.

I can build libga.a, (using CC -xar... etc) but when I try to compile my own 
code or some of the examples I get linking problems, ie. undefined symbols....

eg. trying to compile ex11.C

Undefined                       first referenced
 symbol                             in file
GAListGenome<int>::__vtbl         
Templates.DB/GAListGenome<int>::GAListGenome<int>(float (*)(GAGenome&), void*).o


eg. trying to compile ex22.C
Undefined                       first referenced
 symbol                             in file
static GA1DArrayGenome<float>::SwapMutator(GAGenome&, float) 
Templates.DB/GA1DArrayGenome<float>::GA1DArrayGenome<float>(unsigned int, float 
(*)(GAGenome&), void*).o
static GA1DArrayGenome<float>::ElementComparator(const GAGenome&, const 
GAGenome&) Templates.DB/GA1DArrayGenome<float>::GA1DArrayGenome<float>(unsigned 
int, float (*)(GAGenome&), void*).o
static GA1DArrayGenome<float>::OnePointCrossover(const GAGenome&, const 
GAGenome&, GAGenome*, GAGenome*) 
Templates.DB/GA1DArrayGenome<float>::GA1DArrayGenome<float>(unsigned int, float 
(*)(GAGenome&), void*).o

I can successfully compile my own code with GAAlleleSet<> and GA1DArrayGenome<> 
but not with GAAlleleSetArray<> and GA1DArrayAlleleGenome<> objects

I have tried various combinations including compiling with NO_AUTO_INST set etc.
Can anyone tell me what I am doing wrong ?

Many thanks.


Simon Ongeri
University of Edinburgh
s.ongeri at ed.ac.uk





More information about the galib mailing list