GAlib and external code
- From: Ben Axelrod <gth694n@xxxxxxxxxxxxxxx>
- Date: Tue, 25 Oct 2005 20:29:08 -0400
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 .
- Follow-Ups:
- Re: GAlib and external code
- From: Ben Axelrod
- Re: GAlib and external code
- Prev by Date: Genetic advantage in interracial mating
- Next by Date: genetic algorithms/programming for art
- Previous by thread: Genetic advantage in interracial mating
- Next by thread: Re: GAlib and external code
- Index(es):
Relevant Pages
|
|