[galib] compilation errors using g++

Andreas Borg andiborg at gmx.de
Sat Mar 11 05:37:56 EST 2006


Hello,

I believe I had similar error messages. Which version of g++ are you 
using? I had to use 3.3 instead of 4.0 (my system default), and I have 
to compile all programs that make use of galib with the same compiler. 
Also tell g++ to link against the libga.a file (I'm not using makefiles, 
so I can't give you advice on that).

Good luck,
Andreas


Alejandro Marcos Aragón wrote:

>Hi all,
>
>I have already a project and I'm at the point that I have to attach the GA 
>part.  When I try to add something related to GA I received "undefined 
>reference" error messages:
>
>/home/aaragon/Desktop/MURI/gui/main.cxx:37: undefined reference to 
>`GA2DBinaryStringGenome::GA2DBinaryStringGenome(unsigned int, unsigned int, 
>float (*)(GAGenome&), void*)'
>/home/aaragon/Desktop/MURI/gui/main.cxx:38: undefined reference to 
>`GASimpleGA::GASimpleGA(GAGenome const&)'
>/home/aaragon/Desktop/MURI/gui/main.cxx:39: undefined reference to 
>`GASimpleGA::populationSize(unsigned int)'
>/tmp/cc5Dbmh2.o: In function `main':
>/usr/local/include/ga/GAParameter.h:78: undefined reference to 
>`GAParameterList::set(char const*, void const*)'
>/tmp/cc5Dbmh2.o: In function `pMutation':
>/usr/local/include/ga/GABaseGA.h:186: undefined reference to 
>`GAParameterList::set(char const*, double)'
>/tmp/cc5Dbmh2.o: In function `pCrossover':
>/usr/local/include/ga/GABaseGA.h:183: undefined reference to 
>`GAParameterList::set(char const*, double)'
>/tmp/cc5Dbmh2.o: In function `evolve':
>/usr/local/include/ga/GABaseGA.h:138: undefined reference to 
>`GAStatistics::flushScores()'
>/tmp/cc5Dbmh2.o: In function `main':
>/home/aaragon/Desktop/MURI/gui/main.cxx:47: undefined reference to 
>`GAStatistics::bestIndividual(unsigned int) const'
>/home/aaragon/Desktop/MURI/gui/main.cxx:118: undefined reference to 
>`GASimpleGA::~GASimpleGA()'
>/home/aaragon/Desktop/MURI/gui/main.cxx:118: undefined reference to 
>`GA2DBinaryStringGenome::~GA2DBinaryStringGenome()'
>/home/aaragon/Desktop/MURI/gui/main.cxx:19: undefined reference to 
>`GARandomSeed(unsigned int)'
>/home/aaragon/Desktop/MURI/gui/main.cxx:118: undefined reference to 
>`GASimpleGA::~GASimpleGA()'
>/home/aaragon/Desktop/MURI/gui/main.cxx:118: undefined reference to 
>`GA2DBinaryStringGenome::~GA2DBinaryStringGenome()'
>collect2: ld returned 1 exit status
>make: *** [a.out] Error 1
>
>Any ideas on what's going on?  The compilation was succesful and the header 
>files are in the right place.  How do I fix this?
>
>Thank you
>
>
>_______________________________________________
>galib mailing list
>galib at mit.edu
>http://mailman.mit.edu/mailman/listinfo/galib
>
>
>  
>




More information about the galib mailing list