Linker problem with classes spreaded over directories

Thorsten Gecks t_gecks at informatik.uni-kl.de
Fri Mar 10 07:06:58 UTC 2000


Hello this is my make output:

>>>>
make[4]: Leaving directory `/home/student/nnsim/nnsim/viewobjects'
make[3]: Leaving directory `/home/student/nnsim/nnsim/viewobjects'
make[3]: Entering directory `/home/student/nnsim/nnsim' 
/bin/sh ../libtool --silent --mode=link g++ -O0 -g3 -Wall
  -I/usr/local/include -D_REENTRANT -o nnsim -L/tmp/kde2l ibs/lib
-L/usr/lib/qt-2.1/lib -L/usr/X11R6/lib -rpath /tmp /kde2libs/lib -rpath
/usr/lib/qt-2.1/lib -rpath /usr/X11R6/ lib nnsimsimulationthread.o
nnsimparseobjectexception.o nns imparseobject.o
nnsimabstractparsenodeexception.o nnsimabst ractparsenode.o nnsimview.o
nnsimdoc.o nnsim.o main.o nnsim view.moc.o nnsimsimulationthread.moc.o
nnsimabstractparseno de.moc.o nnsimdoc.moc.o nnsim.moc.o
./abstractparsenodes/l ibabstractparsenodes.a
./abstractparsenodes/units/libunits. a ./viewobjects/libviewobjects.a
./viewobjects/units/libuni ts.a -lGL -lGLU -lglut -L/usr/local/lib -lqpthr
-lpthread -lkfile -lkdeui -lkdecore -lqt -lXext -lX11

./abstractparsenodes/units/libunits.a(nnsimnormalunit.o): In function
`NNSimNormalUnit::NNSimNormalUnit(NNSimParseObje ct &, NNSimNetwork *,
NNSimDoc *)': 
/home/student/nnsim/nnsim/abstractparsenodes/units/
nnsimnormalunit.cpp:143: undefined reference to 
`NNSimConnection::NNSimConnection(NNSimParseObject &, 
NNSimAbstractUnit *, NNS imNetwork *,NNSimDoc *)' 
collect2: ld returned 1 exit status make[3]: *** [nnsim]
Error 1 make[3]: Leaving directory `/home/student/nnsim/nnsim' make[2]:
*** [all-recursive] Error 1 make[2]: Leaving directory
`/home/student/nnsim/nnsim' make[1]: *** [all-recursive] Error 1 make[1]:
Leaving directory `/home/student/nnsim'
make: *** [all-recursive-am] Error 2 
>>>>

It the class nnsimconnection is in the directory abstractparsenodes, the
class nnsimnormalunit in abstractparsenodes/units. nnsimnormalunit uses an
instance of nnsimconnection, so it seems to me that the linker is trying
to insert the constructor of nnsimnormalunit and doesn't find the
constructor of nnsimconnection, that is neccessary for nnsimnormalunit to
work. So obviously the linker doesn't look in all its supplied libraries,
cause then it would find the constructor (i.e. when i would have placed
anything from  abstractparsenodes/units in abstractparsenodes)

Is there a linker option or any code keyword, that solves this problem ?

ciao

Thorsten





More information about the KDevelop mailing list