GAlib and external code



i am trying to use GAlib to optimize the weights of a neural network. my NN code is in separate .h and .C files. i am having trouble getting the GA to compile with my code. actually, it compiles my code, but cannot link to the required GAlib files. any ideas?

####### relevant section of makefile below #######

include ../makevars

GA_INC_DIR= ..
GA_LIB_DIR= ../ga

INC_DIRS= -I$(GA_INC_DIR)
LIB_DIRS= -L$(GA_LIB_DIR)

..SUFFIXES: .C .cpp
..C.o:
	$(CXX) $(CXXFLAGS) $(INC_DIRS) -c $<

all: NN

NN: NN.o BPLink.o BPNode.o BPNet.o
$(CXX) -o NN $(LIB_DIRS) -lga -lm $(CXX_LIBS) NN.o BPLink.o BPNode.o BPNet.o


####### linking error below #######

g++ -g -Wall -I.. -c NN.C
g++ -g -Wall -I.. -c BPLink.C
g++ -g -Wall -I.. -c BPNode.C
g++ -g -Wall -I.. -c BPNet.C
BPNet.C: In member function `int BPNet::getNumNodes(int)':
BPNet.C:174: warning: comparison between signed and unsigned integer expressions


g++ -o NN -L../ga -lga -lm NN.o BPLink.o BPNode.o BPNet.o
NN.o: In function `_ZNK11GAAlleleSetIfE6alleleEj':
/home/Ben/ML/hw2/galib246/examples/../ga/GARealGenome.C:65: undefined reference
to `GAErr(GASourceLocator, char const*, char const*, GAErrorIndex, char const*,
char const*)'
NN.o: In function `_ZN21GA1DArrayAlleleGenomeIfE4readERSi':
/home/Ben/ML/hw2/galib246/examples/../ga/GARealGenome.C:130: undefined reference
to `GAErr(GASourceLocator, char const*, char const*, GAErrorIndex, char const*,
char const*)'



thanks in advance, -Ben .



Relevant Pages

  • Re: GAlib and external code
    ... i am having trouble getting the GA to compile with my code. ... to `GAErr(GASourceLocator, char const*, char const*, GAErrorIndex, char const*, ...
    (comp.ai.genetic)
  • FW: GCC compiling errors
    ... reference to `Util::getParam(char const*, char const*, char const*, ... check your Vodafone Mail and send web2TXT online: ... If you are not the named recipient and receive this correspondence in error, you must not copy, ...
    (RedHat)
  • RE: GCC compiling errors
    ... reference to `Util::getParam(char const*, char const*, char const*, ... check your Vodafone Mail and send web2TXT online: ... If you are not the named recipient and receive this correspondence in error, you must not copy, ...
    (RedHat)
  • GCC compiling errors
    ... I have a user trying to compile on a newly installed server but he's ... reference to `Util::getParam(char const*, char const*, char const*, ... not represent those of Vodafone New Zealand Limited. ...
    (RedHat)
  • Re: safe alternative to va_arg
    ... error messages (I will probably make this a bit more general with some ... Passing 'int' by reference is overkill. ... print(char const* msg, A1 const& a1); ...
    (microsoft.public.vc.language)