<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when I import all the GA Library files and "Build" it, it shows (In VC++ 2005 Express Edition)....</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Creating library...<BR>GATree.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GAListGenome.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GAList.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GAAllele.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GA3DArrayGenome.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GA2DArrayGenome.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>GA1DArrayGenome.obj : warning LNK4221: no public symbols found; archive member will be inaccessible<BR>
<TABLE width="100%" bgColor=#dfdfe5>
<TBODY>
<TR>
<TD><FONT face=arial size=+2>Results </FONT></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD width=0 bgColor=#ededf5>&nbsp;</TD>
<TD width=0 bgColor=#ffffff>&nbsp;</TD>
<TD><PRE><STRONG>Build log was saved at "file://d:\galib246\project\vcpp2005\ga\Release\BuildLog.htm"
ga - 0 error(s), 7 warning(s)</STRONG>
</PRE></TD></TR></TBODY></TABLE></DIV>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>Ignoring the warnings when I import&nbsp; an example from the 'examples' given with "galib246", then it's showing many errors.I'm sending those errors&nbsp;for the example(ex9.cpp) I used. Is there any problem in the example ex9.cpp? </P>
<P>&nbsp;</P>
<P>I followed&nbsp;instructions from &nbsp;&nbsp;</P>
<DIV><A href="http://hyperdrifter.com/index.php?option=com_content&amp;task=view&amp;id=13&amp;Itemid=1" target=_blank rel=nofollow><FONT color=#0000ff>http://hyperdrifter.com/index.php?option=com_content&amp;task=view&amp;id=13&amp;Itemid=1</FONT></A></DIV>
<P>&nbsp;</P>
<P>With Regards</P>
<P>Somnath</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD><PRE>Compiling...
ex9.cpp
Compiling manifest to resources...
Linking...
ex9.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall GASimpleGA::~GASimpleGA(void)" (??1GASimpleGA@@UAE@XZ) referenced in function _main
ex9.obj : error LNK2019: unresolved external symbol "public: float __thiscall GABin2DecGenome::phenotype(unsigned int)const " (?phenotype@GABin2DecGenome@@QBEMI@Z) referenced in function _main
ex9.obj : error LNK2019: unresolved external symbol "public: class GAGenome const &amp; __thiscall GAStatistics::bestIndividual(unsigned int)const " (?bestIndividual@GAStatistics@@QBEABVGAGenome@@I@Z) referenced in function _main
ex9.obj : error LNK2019: unresolved external symbol "public: virtual int __thiscall GASimpleGA::populationSize(unsigned int)" (?populationSize@GASimpleGA@@UAEHI@Z) referenced in function _main
ex9.obj : error LNK2001: unresolved external symbol "float gaDefSigmaTruncationMultiplier" (?gaDefSigmaTruncationMultiplier@@3MA)
ex9.obj : error LNK2019: unresolved external symbol "public: __thiscall GASimpleGA::GASimpleGA(class GAGenome const &amp;)" (??0GASimpleGA@@QAE@ABVGAGenome@@@Z) referenced in function _main
ex9.obj : error LNK2019: unresolved external symbol "public: void __thiscall GABin2DecPhenotype::add(unsigned int,float,float)" (?add@GABin2DecPhenotype@@QAEXIMM@Z) referenced in function _main
ex9.obj : error LNK2019: unresolved external symbol "public: float __thiscall GASigmaTruncationScaling::multiplier(float)" (?multiplier@GASigmaTruncationScaling@@QAEMM@Z) referenced in function "public: __thiscall GASigmaTruncationScaling::GASigmaTruncationScaling(float)" (??0GASigmaTruncationScaling@@QAE@M@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GASigmaTruncationScaling::evaluate(class GAPopulation const &amp;)" (?evaluate@GASigmaTruncationScaling@@UAEXABVGAPopulation@@@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: void __thiscall GAStatistics::flushScores(void)" (?flushScores@GAStatistics@@QAEXXZ) referenced in function "public: virtual void __thiscall GAGeneticAlgorithm::evolve(unsigned int)" (?evolve@GAGeneticAlgorithm@@UAEXI@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: int __thiscall GAParameterList::set(char const *,void const *)" (?set@GAParameterList@@QAEHPBDPBX@Z) referenced in function "public: int __thiscall GAParameterList::set(char const *,unsigned int)" (?set@GAParameterList@@QAEHPBDI@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: int __thiscall GAParameterList::set(char const *,double)" (?set@GAParameterList@@QAEHPBDN@Z) referenced in function "public: float __thiscall GAGeneticAlgorithm::pCrossover(float)" (?pCrossover@GAGeneticAlgorithm@@QAEMM@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: int __thiscall GAStatistics::flushFrequency(unsigned int)" (?flushFrequency@GAStatistics@@QAEHI@Z) referenced in function "public: int __thiscall GAGeneticAlgorithm::flushFrequency(unsigned int)" (?flushFrequency@GAGeneticAlgorithm@@QAEHI@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: class GAScalingScheme &amp; __thiscall GAPopulation::scaling(class GAScalingScheme const &amp;)" (?scaling@GAPopulation@@QAEAAVGAScalingScheme@@ABV2@@Z) referenced in function "public: virtual class GAScalingScheme &amp; __thiscall GASimpleGA::scaling(class GAScalingScheme const &amp;)" (?scaling@GASimpleGA@@UAEAAVGAScalingScheme@@ABV2@@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: __thiscall GABin2DecPhenotypeCore::GABin2DecPhenotypeCore(void)" (??0GABin2DecPhenotypeCore@@QAE@XZ) referenced in function "public: __thiscall GABin2DecPhenotype::GABin2DecPhenotype(void)" (??0GABin2DecPhenotype@@QAE@XZ)
ex9.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall GA1DBinaryStringGenome::~GA1DBinaryStringGenome(void)" (??1GA1DBinaryStringGenome@@UAE@XZ) referenced in function __unwindfunclet$??0GABin2DecGenome@@QAE@ABVGABin2DecPhenotype@@P6AMAAVGAGenome@@@ZPAX@Z$0
ex9.obj : error LNK2019: unresolved external symbol "int __cdecl GABinaryDecode(float &amp;,unsigned char const *,unsigned int,float,float)" (?GABinaryDecode@@YAHAAMPBEIMM@Z) referenced in function "public: __thiscall GABin2DecGenome::GABin2DecGenome(class GABin2DecPhenotype const &amp;,float (__cdecl*)(class GAGenome &amp;),void *)" (??0GABin2DecGenome@@QAE@ABVGABin2DecPhenotype@@P6AMAAVGAGenome@@@ZPAX@Z)
ex9.obj : error LNK2019: unresolved external symbol "int __cdecl GABinaryEncode(float &amp;,unsigned char *,unsigned int,float,float)" (?GABinaryEncode@@YAHAAMPAEIMM@Z) referenced in function "public: __thiscall GABin2DecGenome::GABin2DecGenome(class GABin2DecPhenotype const &amp;,float (__cdecl*)(class GAGenome &amp;),void *)" (??0GABin2DecGenome@@QAE@ABVGABin2DecPhenotype@@P6AMAAVGAGenome@@@ZPAX@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: static float __cdecl GA1DBinaryStringGenome::BitComparator(class GAGenome const &amp;,class GAGenome const &amp;)" (?BitComparator@GA1DBinaryStringGenome@@SAMABVGAGenome@@0@Z) referenced in function "public: __thiscall GABin2DecGenome::GABin2DecGenome(class GABin2DecPhenotype const &amp;,float (__cdecl*)(class GAGenome &amp;),void *)" (??0GABin2DecGenome@@QAE@ABVGABin2DecPhenotype@@P6AMAAVGAGenome@@@ZPAX@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: __thiscall GA1DBinaryStringGenome::GA1DBinaryStringGenome(unsigned int,float (__cdecl*)(class GAGenome &amp;),void *)" (??0GA1DBinaryStringGenome@@QAE@IP6AMAAVGAGenome@@@ZPAX@Z) referenced in function "public: __thiscall GABin2DecGenome::GABin2DecGenome(class GABin2DecPhenotype const &amp;,float (__cdecl*)(class GAGenome &amp;),void *)" (??0GABin2DecGenome@@QAE@ABVGABin2DecPhenotype@@P6AMAAVGAGenome@@@ZPAX@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual class GAGenome * __thiscall GABin2DecGenome::clone(enum GAGenome::CloneMethod)const " (?clone@GABin2DecGenome@@UBEPAVGAGenome@@W4CloneMethod@2@@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GABin2DecGenome::copy(class GAGenome const &amp;)" (?copy@GABin2DecGenome@@UAEXABVGAGenome@@@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall GABin2DecGenome::read(class std::basic_istream &gt; &amp;)" (?read@GABin2DecGenome@@UAEHAAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall GABin2DecGenome::write(class std::basic_ostream &gt; &amp;)const " (?write@GABin2DecGenome@@UBEHAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall GABin2DecGenome::equal(class GAGenome const &amp;)const " (?equal@GABin2DecGenome@@UBEHABVGAGenome@@@Z)
ex9.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall GABin2DecGenome::notequal(class GAGenome const &amp;)const " (?notequal@GABin2DecGenome@@UBEHABVGAGenome@@@Z)
ex9.obj : error LNK2019: unresolved external symbol "public: __thiscall GABin2DecPhenotypeCore::GABin2DecPhenotypeCore(class GABin2DecPhenotypeCore const &amp;)" (??0GABin2DecPhenotypeCore@@QAE@ABV0@@Z) referenced in function "public: __thiscall GABin2DecPhenotype::GABin2DecPhenotype(class GABin2DecPhenotype const &amp;)" (??0GABin2DecPhenotype@@QAE@ABV0@@Z)
D:\galib246\project\ex9\Debug\ex9.exe : fatal error LNK1120: 27 unresolved externals
</PRE></TD></TR></TBODY></TABLE>
<TABLE width="100%" bgColor=#dfdfe5>
<TBODY>
<TR>
<TD><FONT face=arial size=+2>Results </FONT></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD width=0 bgColor=#ededf5>&nbsp;</TD>
<TD width=0 bgColor=#ffffff>&nbsp;</TD>
<TD><PRE><STRONG>Build log was saved at "file://d:\galib246\project\ex9\ex9\Debug\BuildLog.htm"
ex9 - 28 error(s), 0 warning(s)</STRONG>
</PRE></TD></TR></TBODY></TABLE></P></DIV>
<P>&nbsp;</P>
<DIV><BR><BR>/* ----------------------------------------------------------------------------<BR>&nbsp; ex9.C<BR>&nbsp; mbwall 10apr95<BR>&nbsp; Copyright 1995-1996 Massachusetts Institute of Technology<BR><BR>DESCRIPTION:<BR>&nbsp; Sample program that illustrates how to use a GA to find the maximum value<BR>of a continuous function in two variables.&nbsp; This program uses a binary-to-<BR>decimal genome.<BR>---------------------------------------------------------------------------- */<BR>#include &lt;stdio.h&gt;<BR>#include &lt;ga/ga.h&gt;<BR>#include &lt;ga/std_stream.h&gt;<BR><BR>#define cout STD_COUT<BR><BR>float objective(GAGenome &amp;);<BR><BR>int<BR>main(int argc, char **argv)<BR>{<BR>&nbsp; cout &lt;&lt; "Example 9\n\n";<BR>&nbsp; cout &lt;&lt; "This program finds the maximum value in the function\n";<BR>&nbsp; cout &lt;&lt; "&nbsp; y = - x1^2 - x2^2\n";<BR>&nbsp; cout &lt;&lt; "with the constraints\n";<BR>&nbsp; cout &lt;&lt; "&nbsp; &nbsp; -5
 &lt;= x1 &lt;= 5\n";<BR>&nbsp; cout &lt;&lt; "&nbsp; &nbsp; -5 &lt;= x2 &lt;= 5\n";<BR>&nbsp; cout &lt;&lt; "\n\n"; cout.flush();<BR><BR>// See if we've been given a seed to use (for testing purposes).&nbsp; When you<BR>// specify a random seed, the evolution will be exactly the same each time<BR>// you use that seed number.<BR><BR>&nbsp; unsigned int seed = 0;<BR>&nbsp; for(int i=1; i&lt;argc; i++) {<BR>&nbsp; &nbsp; if(strcmp(argv[i++],"seed") == 0) {<BR>&nbsp; &nbsp; &nbsp; seed = atoi(argv[i]);<BR>&nbsp; &nbsp; }<BR>&nbsp; }<BR><BR>// Declare variables for the GA parameters and set them to some default values.<BR><BR>&nbsp; int popsize&nbsp; = 30;<BR>&nbsp; int ngen&nbsp; &nbsp; = 100;<BR>&nbsp; float pmut&nbsp; = 0.01;<BR>&nbsp; float pcross = 0.6;<BR><BR>// Create a phenotype for two variables.&nbsp; The number of bits you can use to<BR>// represent any number is limited by the type of computer you are using.&nbsp; In<BR>// this case, we use 16
 bits to represent a floating point number whose value<BR>// can range from -5 to 5, inclusive.&nbsp; The bounds on x1 and x2 can be applied<BR>// here and/or in the objective function.<BR><BR>&nbsp; GABin2DecPhenotype map;<BR>&nbsp; map.add(16, -5, 5);<BR>&nbsp; map.add(16, -5, 5);<BR><BR>// Create the template genome using the phenotype map we just made.<BR><BR>&nbsp; GABin2DecGenome genome(map, objective);<BR><BR>// Now create the GA using the genome and run it.&nbsp; We'll use sigma truncation<BR>// scaling so that we can handle negative objective scores.<BR><BR>&nbsp; GASimpleGA ga(genome);<BR>&nbsp; GASigmaTruncationScaling scaling;<BR>&nbsp; ga.populationSize(popsize);<BR>&nbsp; ga.nGenerations(ngen);<BR>&nbsp; ga.pMutation(pmut);<BR>&nbsp; ga.pCrossover(pcross);<BR>&nbsp; ga.scaling(scaling);<BR>&nbsp; ga.scoreFilename("bog.dat");<BR>&nbsp; ga.scoreFrequency(10);<BR>&nbsp; ga.flushFrequency(50);<BR>&nbsp; ga.evolve(seed);<BR><BR>// Dump the
 results of the GA to the screen.<BR><BR>&nbsp; genome = ga.statistics().bestIndividual();<BR>&nbsp; cout &lt;&lt; "the ga found an optimum at the point (";<BR>&nbsp; cout &lt;&lt; genome.phenotype(0) &lt;&lt; ", " &lt;&lt; genome.phenotype(1) &lt;&lt; ")\n\n";<BR>&nbsp; cout &lt;&lt; "best of generation data are in '" &lt;&lt; ga.scoreFilename() &lt;&lt; "'\n";<BR><BR>&nbsp; return 0;<BR>}<BR><BR><BR>// This objective function tries to maximize the value of the function<BR>//<BR>//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y = -(x1*x1 + x2*x2)<BR>//<BR>float<BR>objective(GAGenome &amp; c)<BR>{<BR>&nbsp; GABin2DecGenome &amp; genome = (GABin2DecGenome &amp;)c;<BR><BR>&nbsp; float y;<BR>&nbsp; y = -genome.phenotype(0) * genome.phenotype(0);<BR>&nbsp; y -= genome.phenotype(1) * genome.phenotype(1);<BR>&nbsp; return y;<BR>}<BR></DIV>
<DIV id=highlighterDiv style="DISPLAY: none; BACKGROUND-COLOR: yellow"></DIV></DIV><BR></DIV></DIV></DIV><BR></DIV></DIV></div><br>


      <!--4--><hr size=1></hr> 5, 50, 500, 5000 - Store N number of mails in your inbox. <a href="http://in.rd.yahoo.com/tagline_mail_4/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/">Click here.</a></body></html>