[galib] Could you help me to solver this problem

ter xx wong_anurak at yahoo.com
Sat Apr 19 04:24:19 EDT 2008


  Dear sir.
   
           This is my frist time for using your galib. I download the galib247 and create the library with command
  nmake /f makefile.vcpp
             and then i get the galib.lib with some warning as below
   
  [Warning....]
  Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
          cd ga
        nmake /nologo /f makefile.vcpp
        lib.exe /nologo /out:ga.lib garandom.o gaerror.o GAParameter.o GAStatist
ics.o GABaseGA.o GASStateGA.o GASimpleGA.o GAIncGA.o GADemeGA.o GADCrowdingGA.o
GASelector.o GAScaling.o GAPopulation.o GAGenome.o GABinStr.o gabincvt.o GAAllel
e.o GA1DBinStrGenome.o GA2DBinStrGenome.o GA3DBinStrGenome.o GABin2DecGenome.o G
A1DArrayGenome.o GA2DArrayGenome.o GA3DArrayGenome.o GATreeBASE.o GATree.o GATre
eGenome.o GAListBASE.o GAList.o GAListGenome.o
GAList.o : warning LNK4221: no public symbols found; archive member will be inac
cessible
GATreeGenome.o : warning LNK4221: no public symbols found; archive member will b
e inaccessible
GATree.o : warning LNK4221: no public symbols found; archive member will be inac
cessible
GA3DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GA2DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GA1DArrayGenome.o : warning LNK4221: no public symbols found; archive member wil
l be inaccessible
GAAllele.o : warning LNK4221: no public symbols found; archive member will be in
accessible
ga is now up-to-date
        cd ..
        cd examples
        nmake /nologo /f makefile.vcpp
        cd ..
  [End Warning]
   
  and after i use the galib.lib in my program. I develop my program with vc++.net base on window vista businees version and visual studio 2008. this is my some code :
   
  [code]
    
  #include <ga/GA1DArrayGenome.h>
  #include <ga/std_stream.h>
  //#include "ga/GASStateGA.h"
  #pragma once
  float Objective(GAGenome &);
  ref class IntegerSolver
  {
  
  public:
  IntegerSolver(void);
   
  float Objective(GAGenome & g)
  {
  //GA1DArrayGenome<int> &genome = (GA1DArrayGenome<int> &)g;
  float score=0.0;
  int count=0;
  // for(int i=0; i<genome.width(); i++){
  
  // count++;
  // }
  
  return score;
  }
  void GAStart(){
  int width = 10;
  //int height = 5;
  int popsize = 2000;
  //int ngen = 400;
  float pmut = 0.001;
  float pcross = 0.9;
  GA1DArrayGenome<int> genome(width, ::Objective );
  }
  };
   
  [/code]
   
  I set the project option > c\c++ >advanced > complie as > "Complie as C++ code (/TP)"  and I get the error as below after i complie. 
   
  [error]
  1>------ Build started: Project: DSS, Configuration: Debug Win32 ------
  1>Compiling...
  1>IntegerSolver.cpp
  1>DSS.cpp
  1>Generating Code...
  1>Linking...
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A00000E) "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome<int>::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
  1>DSS.obj : error LNK2028: unresolved token (0A00000F) "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome<int>::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
  1>IntegerSolver.obj : error LNK2020: unresolved token (0A00001A) "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ)
  1>DSS.obj : error LNK2028: unresolved token (0A00001A) "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ) referenced in function "public: virtual __clrcall GA1DArrayGenome<int>::~GA1DArrayGenome<int>(void)" (??1?$GA1DArrayGenome at H@@$$FUAM at XZ)
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A00001B) "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: static void __clrcall std::_String_base::_Xlen(void)" (?_Xlen at _String_base@std@@$$FSMXXZ)
  1>DSS.obj : error LNK2028: unresolved token (0A00001B) "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: __clrcall GA1DArrayGenome<int>::GA1DArrayGenome<int>(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A00001C) "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome<int>::GA1DArrayGenome<int>(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
  1>DSS.obj : error LNK2028: unresolved token (0A00001C) "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome<int>::GA1DArrayGenome<int>(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A000021) "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
  1>DSS.obj : error LNK2028: unresolved token (0A0000D6) "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A000024) "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
  1>DSS.obj : error LNK2028: unresolved token (0A0000D9) "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
  1>IntegerSolver.obj : error LNK2028: unresolved token (0A000027) "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome<int>::read(class std::basic_istream<char,struct std::char_traits<char> > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
  1>DSS.obj : error LNK2028: unresolved token (0A0000DC) "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome<int>::read(class std::basic_istream<char,struct std::char_traits<char> > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
  1>IntegerSolver.obj : error LNK2020: unresolved token (0A000028) "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z)
  1>DSS.obj : error LNK2028: unresolved token (0A0000DD) "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z) referenced in function "public: virtual void __clrcall GA1DArrayGenome<int>::copy(class GAGenome const &)" (?copy@?$GA1DArrayGenome at H@@$$FUAMXABVGAGenome@@@Z)
  1>DSS.obj : error LNK2019: unresolved external symbol "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ) referenced in function "int __clrcall GARandomInt(int,int)" (?GARandomInt@@$$FYMHHH at Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "float __clrcall garan2(void)" (?garan2@@$$FYMMXZ)
  1>DSS.obj : error LNK2019: unresolved external symbol "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ) referenced in function "public: virtual __clrcall GA1DArrayGenome<int>::~GA1DArrayGenome<int>(void)" (??1?$GA1DArrayGenome at H@@$$FUAM at XZ)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: virtual __clrcall GAGenome::~GAGenome(void)" (??1GAGenome@@$$FUAM at XZ)
  1>DSS.obj : error LNK2019: unresolved external symbol "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z) referenced in function "public: virtual int __clrcall GA1DArrayGenome<int>::read(class std::basic_istream<char,struct std::char_traits<char> > &)" (?read@?$GA1DArrayGenome at H@@$$FUAMHAAV?$basic_istream at DU?$char_traits at D@std@@@std@@@Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "void __clrcall GAErr(class GASourceLocator,char const *,char const *,enum GAErrorIndex,char const *,char const *)" (?GAErr@@$$FYMXVGASourceLocator@@PBD1W4GAErrorIndex@@11 at Z)
  1>DSS.obj : error LNK2019: unresolved external symbol "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z) referenced in function "public: virtual void __clrcall GA1DArrayGenome<int>::copy(class GAGenome const &)" (?copy@?$GA1DArrayGenome at H@@$$FUAMXABVGAGenome@@@Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: virtual void __clrcall GAGenome::copy(class GAGenome const &)" (?copy at GAGenome@@$$FUAMXABV1@@Z)
  1>DSS.obj : error LNK2019: unresolved external symbol "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ) referenced in function "public: static int __clrcall GA1DArrayGenome<int>::OnePointCrossover(class GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome *)" (?OnePointCrossover@?$GA1DArrayGenome at H@@$$FSMHABVGAGenome@@0PAV2 at 1@Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "int __clrcall GARandomBit(void)" (?GARandomBit@@$$FYMHXZ)
  1>DSS.obj : error LNK2019: unresolved external symbol "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z) referenced in function "public: __clrcall GA1DArrayGenome<int>::GA1DArrayGenome<int>(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: __clrcall GAGenome::GAGenome(void (__clrcall*)(class GAGenome &),int (__clrcall*)(class GAGenome &,float),float (__clrcall*)(class GAGenome const &,class GAGenome const &))" (??0GAGenome@@$$FQAM at P6MXAAV0@@ZP6MH0M at ZP6MMABV0@3 at Z@Z)
  1>DSS.obj : error LNK2019: unresolved external symbol "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z) referenced in function "public: __clrcall GA1DArrayGenome<int>::GA1DArrayGenome<int>(unsigned int,float (__clrcall*)(class GAGenome &),void *)" (??0?$GA1DArrayGenome at H@@$$FQAM at IP6MMAAVGAGenome@@@ZPAX at Z)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "public: static void __clrcall GAGenome::NoInitializer(class GAGenome &)" (?NoInitializer at GAGenome@@$$FSMXAAV1@@Z)
  1>DSS.obj : error LNK2019: unresolved external symbol "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z) referenced in function "public: void __clrcall IntegerSolver::GAStart(void)" (?GAStart at IntegerSolver@@$$FQ$AAMXXZ)
  1>IntegerSolver.obj : error LNK2001: unresolved external symbol "float __clrcall Objective(class GAGenome &)" (?Objective@@$$FYMMAAVGAGenome@@@Z)
  1>D:\proc\DSS\Debug\DSS.exe : fatal error LNK1120: 24 unresolved externals
  1>Build log was saved at "file://d:\proc\DSS\DSS\Debug\BuildLog.htm"
  1>DSS - 33 error(s), 0 warning(s)
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  [/error]
   
  thank you for your help. 


 Anurak Wongwaichaicharoen

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20080419/bb37d65e/attachment.htm


More information about the galib mailing list