[galib] galib Digest, Vol 54, Issue 6

Steven Bilton swb04 at doc.ic.ac.uk
Sun Jan 27 13:12:09 EST 2008


No worries, fixed it. In case anybody was wondering, it involves 
including GARealGenome.C and GARealGenome.h, but not compiling 
GARealGenome.C. =)

Steve

----------

galib-request at mit.edu wrote:
> Send galib mailing list submissions to
> 	galib at mit.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mailman.mit.edu/mailman/listinfo/galib
> or, via email, send a message with subject or body 'help' to
> 	galib-request at mit.edu
>
> You can reach the person managing the list at
> 	galib-owner at mit.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of galib digest..."
>
>
> Today's Topics:
>
>    1. VS2005 Linker Errors with GARealAllele (Steven Bilton)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 26 Jan 2008 19:04:29 +0000
> From: Steven Bilton <swb04 at doc.ic.ac.uk>
> Subject: [galib] VS2005 Linker Errors with GARealAllele
> To: galib at mit.edu
> Message-ID: <479B843D.7010206 at doc.ic.ac.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hey,
>
> I'm having issues compiling the library under VS2005 when using the 
> GARealAllele. I've read about a few problems that relate to requiring 
> casts, but I'm not really sure where they would be needed.
>
> The errors I get are an array of linker errors when including 
> GARealGenome.h along the lines of:
>
> 6>GARealGenome.obj : error LNK2005: "public: float __thiscall 
> GAAlleleSet<float>::allele(void)const " 
> (?allele@?$GAAlleleSet at M@@QBEMXZ) already defined in MyClass.obj
>
> Not including GARealGenome.h of course then causes it to default to the 
> definition in GAAllele.C to be used, giving the undefined 
> allele(unsigned int) error and breaking it.
>
> At present, it will not compile with the following:
>
> ------------------
>
> #include "ga/MyClass.h"                  // Has no GA related headers 
> inside.
> #include "ga/ga.h"
> #include "ga/GARealGenome.h"
> #include "console/console.h"           // Used for other stuff not 
> related to GA
> #include "game/shapeBase.h"         // Used for other stuff not related 
> to GA
> #include <windows.h>                  // Used for other stuff not 
> related to GA
>
> #define INSTANTIATE_REAL_GENOME
>
> float fitnessFunction(GAGenome& g)
> {
>     return 0;
> }
>
> void MyClass::run()
> {
>     GARealAlleleSetArray alleles;
>     alleles.add(0,1);
>     GARealGenome genome(alleles, fitnessFunction);
> }
>
> ------------------
>
> Any pointers appreciated.
>
> Cheers
> Steve
>
>
> ------------------------------
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib
>
>
> End of galib Digest, Vol 54, Issue 6
> ************************************
>   



More information about the galib mailing list