Problems compiling the examples
Petrakos P. Kyriakos
petrakos at ceid.upatras.gr
Thu May 24 07:34:46 EDT 2001
Kyle,
Thank you for your help...it was quit useful.I have followed your
instructions and managed to reduce the number of errors.But I still have
some problems. For instance, during the compilation of ex1.C file, which
is included in galib\examples direcotry, I receive the following strange
error:
--------------------------------------------------------------------------------------------
Compiling...
ex1.C
c:\windows\desktop\ex1.c(70) : error C2679: binary '<<' : no operator
defined which takes a right-hand operand of type 'const class GAGenome'
(or there is no acceptable conversion)
Error executing cl.exe.
--------------------------------------------------------------------------------------------
In contrast with ex1.C file, I face no problems with the compilation of
the ex2.C file in the same directory. But when trying to link the .obj
file, I receive the following error messages:
--------------------------------------------------------------------------------------------
Linking...
ex2.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall GASimpleGA::~GASimpleGA(void)" (??1GASimpleGA@@UAE at XZ)
ex2.obj : error LNK2001: unresolved external symbol "public: class
GAGenome const & __thiscall GAStatistics::bestIndividual(unsigned
int)const " (?bestIndividual at GAStatistics@@QBEABVGAGenome@@I at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: float
__thiscall GABin2DecGenome::phenotype(unsigned int)const
" (?phenotype at GABin2DecGenome@@QBEMI at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual int
__thiscall GASimpleGA::populationSize(unsigned
int)" (?populationSize at GASimpleGA@@UAEHI at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: __thiscall
GASimpleGA::GASimpleGA(class GAGenome const
&)" (??0GASimpleGA@@QAE at ABVGAGenome@@@Z)
ex2.obj : error LNK2001: unresolved external symbol "public: void
__thiscall GABin2DecPhenotype::add(unsigned
int,float,float)" (?add at GABin2DecPhenotype@@QAEXIMM at Z)
ex2.obj : error LNK2001: unresolved external symbol "void __cdecl
GARandomSeed(unsigned int)" (?GARandomSeed@@YAXI at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: void
__thiscall
GAStatistics::flushScores(void)" (?flushScores at GAStatistics@@QAEXXZ)
ex2.obj : error LNK2001: unresolved external symbol "public: int
__thiscall GAParameterList::set(char const *,void const
*)" (?set at GAParameterList@@QAEHPBDPBX at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: int
__thiscall GAParameterList::set(char const
*,double)" (?set at GAParameterList@@QAEHPBDN at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: int
__thiscall GAStatistics::flushFrequency(unsigned
int)" (?flushFrequency at GAStatistics@@QAEHI at Z)
ex2.obj : error LNK2001: unresolved external symbol "float __cdecl
ran2(void)" (?ran2@@YAMXZ)
ex2.obj : error LNK2001: unresolved external symbol "public: __thiscall
GABin2DecPhenotypeCore::GABin2DecPhenotypeCore(void)" (??0GABin2DecPhenotypeCore@@QAE at XZ)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual int
__thiscall GABin2DecGenome::notequal(class GAGenome const &)const
" (?notequal at GABin2DecGenome@@UBEHABVGAGenome@@@Z)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual int
__thiscall GABin2DecGenome::equal(class GAGenome const &)const
" (?equal at GABin2DecGenome@@UBEHABVGAGenome@@@Z)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual void
__thiscall GABin2DecGenome::copy(class GAGenome const
&)" (?copy at GABin2DecGenome@@UAEXABVGAGenome@@@Z)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual class
GAGenome * __thiscall GABin2DecGenome::clone(enum
GAGenome::CloneMethod)const
" (?clone at GABin2DecGenome@@UBEPAVGAGenome@@W4CloneMethod at 2@@Z)
ex2.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall
GA1DBinaryStringGenome::~GA1DBinaryStringGenome(void)" (??1GA1DBinaryStringGenome@@UAE at XZ)
ex2.obj : error LNK2001: unresolved external symbol "int __cdecl
GABinaryDecode(float &,unsigned char const *,unsigned
int,float,float)" (?GABinaryDecode@@YAHAAMPBEIMM at Z)
ex2.obj : error LNK2001: unresolved external symbol "int __cdecl
GABinaryEncode(float &,unsigned char *,unsigned
int,float,float)" (?GABinaryEncode@@YAHAAMPAEIMM at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: static float
__cdecl GA1DBinaryStringGenome::BitComparator(class GAGenome const &,class
GAGenome const
&)" (?BitComparator at GA1DBinaryStringGenome@@SAMABVGAGenome@@0 at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: __thiscall
GA1DBinaryStringGenome::GA1DBinaryStringGenome(unsigned int,float
(__cdecl*)(class GAGenome &),void
*)" (??0GA1DBinaryStringGenome@@QAE at IP6AMAAVGAGenome@@@ZPAX at Z)
ex2.obj : error LNK2001: unresolved external symbol "public: __thiscall
GABin2DecPhenotypeCore::GABin2DecPhenotypeCore(class
GABin2DecPhenotypeCore const &)" (??0GABin2DecPhenotypeCore@@QAE at ABV0@@Z)
Debug/ex2.exe : fatal error LNK1120: 23 unresolved externals
Error executing link.exe.
ex2.exe - 24 error(s), 0 warning(s)
--------------------------------------------------------------------------------------------
The result is that the .exe file cannot be created. Is anyone aware of
what is going wrong? For the sake of conception, I also attach the two
files mentioned abobe (it ) ...
Your help would be extremely useful, as I am constantly engaging with
evolutionary computing this period, and I am obliged to implement some
classes by myself, as I cannot use Galib.
Thank you in advance.
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| Petrakos Kyriakos |
| Computer Engineering and Informatics Dept. |
| University of Patras - Greece |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
|"What we cannot speak about we must pass over in silence"|
| L. Wittgenstein |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
More information about the galib
mailing list