[galib] Re: galib Digest, Vol 16, Issue 1
Chunguo Wu
wuchunguo at email.jlu.edu.cn
Mon Oct 4 20:05:35 EDT 2004
Maybe you did not include the related header file properly.
======= 2004-10-05 00:05:45 You 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. Defining GALIB class objects (Mert Tas)
>
>
>----------------------------------------------------------------------
>
>Date: Mon, 4 Oct 2004 08:01:48 -0700 (PDT)
>From: Mert Tas <mert_tas at yahoo.com>
>To: galib at mit.edu
>Subject: [galib] Defining GALIB class objects
>Message-ID: <20041004150148.88030.qmail at web50905.mail.yahoo.com>
>Content-Type: multipart/alternative; boundary="0-75371785-1096902108=:86075"
>MIME-Version: 1.0
>Precedence: list
>Message: 1
>
>--0-75371785-1096902108=:86075
>Content-Type: text/plain; charset=us-ascii
>
>Hi everybody,
>
>I have a problem about defining the GALIB class objects outside the main().
>For example when I want to define a GA1DBinaryStringGenome object inside a function other than main() as follows:
>
>int SomeFunction()
>{
> ....
>
>GA1DBinaryStringGenome genome(20, objective);
>
>GASteadyStateGA ga(genome);
>
>......
>
>}
>
>int main() {
>
>SomeFunction();
>
>return 0;
>
>}
>
>the compiler gives the following error:
>
>Error C2664
>'__thiscall GA1DBinaryStringGenome::GA1DBinaryStringGenome(unsigned int,float (__cdecl *)(class GAGenome &),void *)' : cannot convert parameter 2 from 'float (class GAGenome &)' to 'float (__cdecl *)(class GAGenome &)'
>
>Does anybody have any suggestion how to define these GALIB class objects inside a function ?
>Thanks and bye.
>
>
>
>
>---------------------------------
>Do you Yahoo!?
>vote.yahoo.com - Register online to vote today!
>--0-75371785-1096902108=:86075
>Content-Type: text/html; charset=us-ascii
>
><DIV>Hi everybody, </DIV>
><DIV> </DIV>
><DIV>I have a problem about defining the GALIB class objects outside the main().</DIV>
><DIV>For example when I want to define a GA1DBinaryStringGenome object inside a function other than main() as follows:</DIV>
><DIV> </DIV>
><DIV>int SomeFunction()</DIV>
><DIV>{</DIV>
><DIV> ....</DIV>
><DIV><FONT color=#0000ff>
><P></FONT>GA1DBinaryStringGenome genome(20, objective);</P><FONT color=#0000ff>
><P></FONT><FONT>GASteadyStateGA ga(genome);</FONT></P>
><P>......</P>
><P>}</P>
><P>int main() {</P>
><P>SomeFunction();</P>
><P>return 0;</P>
><P>}</P></DIV>
><DIV>the compiler gives the following error:</DIV>
><DIV> </DIV>
><DIV>Error C2664</DIV>
><DIV>'__thiscall GA1DBinaryStringGenome::GA1DBinaryStringGenome(unsigned int,float (__cdecl *)(class GAGenome &),void *)' : cannot convert parameter 2 from 'float (class GAGenome &)' to 'float (__cdecl *)(class GAGenome &)'</DIV>
><DIV> </DIV>
><DIV>Does anybody have any suggestion how to define these GALIB class objects inside a function ?</DIV>
><DIV>Thanks and bye.</DIV>
><DIV> </DIV>
><DIV> </DIV><p>
> <hr size=1>Do you Yahoo!?<br><a
>href="http://vote.yahoo.com">vote.yahoo.com</a> - Register online to vote today!
>--0-75371785-1096902108=:86075--
>------------------------------
>
>_______________________________________________
>galib mailing list
>galib at mit.edu
>http://mailman.mit.edu/mailman/listinfo/galib
>
>
>End of galib Digest, Vol 16, Issue 1
>************************************
= = = = = = = = = = = = = = = = = = = =
Regards
Chunguo
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Chunguo Wu
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡wuchunguo at email.jlu.edu.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-10-05
More information about the galib
mailing list