C++:Linker Error with Constructor of Abstract Class

W. Tasin tasin at e-technik.fh-muenchen.de
Tue Feb 22 11:22:18 GMT 2000


Thorsten Gecks wrote:
> 
> I have an abstract class in my class tree and the linker complains about
> missing reference to constructor/destructor:
> 
> does anybody know, what my problem is ?
> 
> bin/sh ../libtool --silent --mode=link g++  -O0 -g3 -Wall     -o nnsim
> -L/usr/lib  -L/usr/X11R6/lib -rpath /usr/lib -rpath /usr/X11R6/lib
> anothertrie.o justatrie.o nnsimparseobjectexception.o  justatrie.moc.o
> nnsimabstractparsenode.moc.o nnsimdoc.moc.o nnsim.moc.o nnsimview.moc.o
> nnsimabstractparsenode.o nnsimparseobject.o nnsimabstractparsenodeexception.o
> nnsimview.o nnsimdoc.o nnsim.o main.o ./abstractparsenodes/libabstractparsenodes.a
> ./viewobjects/libviewobjects.a ./abstractparsenodes/units/libunits.a
> -lkfile -lkfm -lkdeui -lkdecore -lqt -lXext -lX11
> 
> gmake[1]: Leaving directory `/home/student/nnsim/nnsim'
> 
> ./abstractparsenodes/units/libunits.a(nnsimnormalunit.o): In function `QListT<NNSimConnection>::~QListT(void)':
> /usr/include/qt/qlist.h(.text+0xf): undefined reference to `NNSimAbstractUnit::NNSimAbstractUnit(void)'
> /usr/include/qt/qlist.h(.text+0x37): undefined reference to `NNSimAbstractUnit::~NNSimAbstractUnit(void)'
> ./abstractparsenodes/units/libunits.a(nnsimnormalunit.o): In function `NNSimNormalUnit::NNSimNormalUnit(NNSimParseObject &, NNSimNetwork *)':
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.cpp:44: undefined reference to `NNSimAbstractUnit::NNSimAbstractUnit(void)'
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.cpp:137: undefined reference to `NNSimConnection::NNSimConnection(NNSimParseObject &, NNSimNetwork *)'
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.cpp:150: undefined reference to `NNSimAbstractUnit::~NNSimAbstractUnit(void)'
> ./abstractparsenodes/units/libunits.a(nnsimnormalunit.o): In function `NNSimNormalUnit::~NNSimNormalUnit(void)':
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.cpp:159: undefined reference to `NNSimAbstractUnit::~NNSimAbstractUnit(void)'
> ./abstractparsenodes/units/libunits.a(nnsimnormalunit.moc.o): In function `NNSimNormalUnit::initMetaObject(void)':
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.moc.cpp:37: undefined reference to `NNSimAbstractUnit::className(void) const'
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.moc.cpp:51: undefined reference to `NNSimAbstractUnit::initMetaObject(void)'
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.moc.cpp:34: undefined reference to `NNSimAbstractUnit type_info function'
> /home/student/nnsim/nnsim/abstractparsenodes/units/nnsimnormalunit.moc.cpp:34: undefined reference to `NNSimAbstractUnit type_info node'
> collect2: ld returned 1 exit status
> gmake[1]: *** [nnsim] Error 1
> 
> Thorsten Gecks
> Universität Kaiserslautern

Hi,

did you connect signals?

It seems there is missing a Q_OBJECT in the class definition of
NNSimAbstractUnit (or its 
derived class).

Bye

Walter
-- 
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,
FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>
<http://wwwkeys.pgp.net:11371/pks/lookup?op=index&search=0x7961A645&fingerprint=on>




More information about the KDevelop mailing list