[galib] Problem in linking GALib

Tariq Saeed Ansari tariqa at student.chalmers.se
Mon Mar 26 13:14:43 EDT 2007


Hello,

     I am new to this list and I have downloaded GALib to use in my
Robotics project. I tried to compile a simple program using GALib but
I am getting a Linking error, although I have already defined the
correct paths for header files and library file(ga.lib). Following is
my program and linking errors that I am getting,

I don't understand what is the problem.

Note: I am using Visual C++ 2005 Express Addition

////// Program code

#include<iostream>

#include <ga/GASimpleGA.h>
#include <ga/GA2DBinStrGenome.h>

using namespace std;

float Objective( GAGenome& );

int main( void )
{
    GA2DBinaryStringGenome genome( 20, 10,Objective, (void*)0 );
}

float Objective( GAGenome& )
{
    return 0.0f;
}

/// Linking Errors I am receiving

------ Build started: Project: simplega, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\program files\microsoft platform sdk for windows server 2003
r2\include\ga\gastatistics.h(164) : warning C4996: 'strcpy': This function
or variable may be unsafe. Consider using strcpy_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        c:\program files\microsoft visual studio 8\vc\include\string.h(74)
: see declaration of 'strcpy'
Linking...
main.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall GA2DBinaryStringGenome::~GA2DBinaryStringGenome(void)"
(??1GA2DBinaryStringGenome@@UAE at XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall
GA2DBinaryStringGenome::GA2DBinaryStringGenome(unsigned int,unsigned
int,float (__cdecl*)(class GAGenome &),void *)"
(??0GA2DBinaryStringGenome@@QAE at IIP6AMAAVGAGenome@@@ZPAX at Z) referenced in
function _main
D:\K_DRIVE\simplega\Debug\simplega.exe : fatal error LNK1120: 2 unresolved
externals
Build log was saved at
"file://d:\K_DRIVE\simplega\simplega\Debug\BuildLog.htm"
simplega - 3 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





More information about the galib mailing list