Problem setting population sorting on MSVC

Allan Findlay allan at
Fri Dec 13 03:25:24 EST 2002

If its the last line then I assume you have 2 (or more) order() functions
which the compiler can't decide between.

The MSVC help files have a help entry for all the errors, C2663 says this:-


'function' : number overloads have no legal conversions for 'this' pointer

The compiler could not convert the this pointer to any of the overloaded
versions of the member function.

This error may be caused by invoking a non-const member function on a const
object. To correct the problem, remove the const from the object declaration
or add const to one of the member function overloads.

The following is an example of this error:

class C {
   void foo() volatile;
   void foo(); // adding const here would fix problem

const C *pcc;

void main()
   pcc->foo();      // error



-----Original Message-----
From: Fredric V. Echols [mailto:rwf at] 
Sent: 10 December 2002 21:45
To: galib at
Subject: Problem setting population sorting on MSVC

Hello everyone,

    I am using a system in which a genetic algorithm is being used to
produce signals, and the fitness function works by determining signal error
using Mean Squared Error. Obviously, the lower the error, the better the
genome is. Anyway, when I try to set the population to use the "lower is
better" mode, I get this from MSVC 6.0:

"error C2663: 'order' : 2 overloads have no legal conversion for 'this'

    Here is the relevant code:

// Genome type
#define GenomeT unsigned char
#define GAGenomeT GA1DArrayAlleleGenome<GenomeT>

// Allele set
GAAlleleSet<GenomeT> Allele(0, 255);

// Genome
GAGenomeT genome(2, Allele, Objective);

// Set up genome

// GA
GASimpleGA ga(genome);

// Set sort order



    The last line is where the problem lies, according to the compiler.

    Thanks for your time!

-Fredric Echols

galib mailing list
galib at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the galib mailing list