Help Regarding GAlib in MSVC++ 6.0

Sunil Jha suniljha at iitk.ac.in
Wed Oct 4 00:39:34 EDT 2000


Dear Mr. Kyle and Liz,
    I have created new Win32 console project with one empty file sgalib.cpp and copy ex25.C in that file. With these options on compiling the file I am getting only two errors :
--------------------Configuration: sgalib - Win32 Debug--------------------
Compiling...
simplega.cpp
d:\ausers\sunil\ga\galib\sgalib\simplega.cpp(50) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'const class GAGenome' (or there is no acceptable conversion)
d:\ausers\sunil\ga\galib\sgalib\simplega.cpp(51) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'const class GAStatistics' (or there is no acceptable conversion)
Error executing cl.exe.

simplega.obj - 2 error(s), 0 warning(s)
________________________________________________________

Please help me by replying Why I am getting these errors? How can i resolve these.

Thanks

Sunil Jha
  ----- Original Message ----- 
  From: Kyle and Liz 
  To: Sunil Jha 
  Sent: Wednesday, October 04, 2000 8:06 AM
  Subject: Re: Help Regarding GAlib in MSVC++ 6.0


  Sunil Jha,
   
  I also got GALib to build in MSVC++ 6.0.  The way I did it was to create a new Win32 Static Library project and just import all the GALib files.  I can't remember everything I had to set to get it to build but I do remember having to set the "/TP" flag compiler setting.  This compiler flag indicates to treat the *.c files as *.cpp files.  I could not find a checkbox for this setting anywhere in the Project->Settings so I had to just enter it in the lower right-hand window in the Project->Settings->C++ tab where the listing of all settings are given.  You can look up "/TP" in the MSDN help library. If you need more help let me know.
   
  Kyle Franzen
  Industrial / Software Engineer
  Omaha, Nebraska, USA
    -----Original Message-----
    From: Sunil Jha <suniljha at iitk.ac.in>
    To: galib at MIT.EDU <galib at MIT.EDU>
    Date: Monday, October 02, 2000 2:38 PM
    Subject: Help Regarding GAlib in MSVC++ 6.0


    Dear Sir,
        I am able to build library in MSVC++6.0, without any difficulty. But when I am trying to compile and build sample programs TSPdemo or some other program downloaded from your website, Compilation is successful but I am recieving following error while linking : 
    --------------------Configuration: tspdemo - Win32 Debug--------------------
    Linking...
    tspdemoView.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GADCrowdingGA::step(void)" (?step at GADCrowdingGA@@UAEXXZ)
    tspdemoView.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GADCrowdingGA::initialize(unsigned int)" (?initialize at GADCrowdingGA@@UAEXI at Z)
    Debug/tspview.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    tspview.exe - 3 error(s), 0 warning(s)
    ---------------------------------------------------------------------------------------------------------------------
    Please write me how can I resolve this kind of error.

    Also Please write explicitly what changes I have to make in GAconfig.h for successful compilation of examples in MSVC++6.0. The original file is creating some problems with cout,cin,ostream,istream etc objects. 

    Please help me by writing email as soon as possible. I am in trouble.Lastly, I would like to express my thanks for such a good library for Genetic algorithm.

    Sunil Jha
    Ph.D Scholar ,
    Mechanical Engg. Department,
    Indian Institute of Technology, Kanpur,
    INDIA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20001004/5a03b5ee/attachment.htm


More information about the galib mailing list