gcc linking: undefined reference to just about everything
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
gcc linking: undefined reference to just about everything
I have a horrendous problem linking a c++ application I am `developing.'
This has something to do with pure abstract classes, virtual inheritence,
destructors, polymorphism, all the big words. The classes appear to
compile correctly, but in the link phase, i get a lot of errors. admittedly
it appears to be the same error repeated for many of the classes:
[snip]
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x24): undefined reference to `typeinfo for patlib::symStrai
ght'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x4c): undefined reference to `patlib::symStraight::myBasStr
aight() const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x68): undefined reference to `typeinfo for patlib::symStrai
ght'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x24): undefined reference to `typeinfo for patlib::symLinear'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x30): undefined reference to `patlib::symLinear::~symLinear [i
n-charge]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x34): undefined reference to `patlib::symLinear::~symLinear [i
n-charge deleting]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x48): undefined reference to `patlib::symLinear::myBasLinear()
const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x64): undefined reference to `typeinfo for patlib::symLinear'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x68): undefined reference to `virtual thunk [v:0,-12] to patli
b::symLinear::~symLinear [in-charge]()'
[snip]
plus many more lines. this is under
gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
from what i've found on the net `in-charge' refers to constructor, and `not-in-charge'
to a destructor. i've seen other people with errors like this, but they were all compiling other's code and had not included linker flags to the correct libraries. i don't think this is my problem, because it appears that i can link things correctly in subdirectories of this project. (oh, yes there are two subdirectories.) i can provide a tgz file with my code and makefile if necessary. any help appreciated!
thanks,
--shabbychef
what follows is my complete error message
----------------------------------------------------------------------
g++ -o test -L/usr/local/lib -L. -L/usr/X11R6/lib -L/usr/qt/3/lib -Lgeometric/ test.o angle.o basedefs.o centered.o curve.o
dist.o dseg.o exceptions.o linear.o line.o obj.o point.o qbez.o quadratic.o quant.o radial.o ray.o straight.o transform.o ve
c.o circular.o circle.o geometric/geometric.o numeric/numeric.o -lplotter -lXaw -lXmu -lXt -lXext -lX11 -lm -lqt -lSM -lICE
-lc -lm -lz -lstdc++ -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/specs
Configured with: /var/tmp/portage/gcc-3.3.5.20050130-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --pr
efix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050
130/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.
3.5-20050130/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/info --with-gxx-include-dir=/usr/lib/gcc-lib
/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-
gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-l
ibgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o
test /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../crt1.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/..
/../../crti.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/crtbegin.o -L/usr/local/lib -L. -L/usr/X11R6/lib -L/usr/qt/3
/lib -Lgeometric/ -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130 -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/..
/../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../.. test.o angle.o basedefs.o cente
red.o curve.o dist.o dseg.o exceptions.o linear.o line.o obj.o point.o qbez.o quadratic.o quant.o radial.o ray.o straight.o
transform.o vec.o circular.o circle.o geometric/geometric.o numeric/numeric.o -lplotter -lXaw -lXmu -lXt -lXext -lX11 -lqt -
lSM -lICE -lm -lz -lstdc++ -lstdc++ -lm -lc -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-2005013
0/crtend.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../crtn.o
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x24): undefined reference to `typeinfo for patlib::symStrai
ght'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x4c): undefined reference to `patlib::symStraight::myBasStr
aight() const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symStraightE+0x68): undefined reference to `typeinfo for patlib::symStrai
ght'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x24): undefined reference to `typeinfo for patlib::symLinear'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x30): undefined reference to `patlib::symLinear::~symLinear [i
n-charge]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x34): undefined reference to `patlib::symLinear::~symLinear [i
n-charge deleting]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x48): undefined reference to `patlib::symLinear::myBasLinear()
const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x64): undefined reference to `typeinfo for patlib::symLinear'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x68): undefined reference to `virtual thunk [v:0,-12] to patli
b::symLinear::~symLinear [in-charge]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_9symLinearE+0x6c): undefined reference to `virtual thunk [v:0,-12] to patli
b::symLinear::~symLinear [in-charge deleting]()'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_12symQuadraticE+0x24): undefined reference to `typeinfo for patlib::symQuad
ratic'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_12symQuadraticE+0x44): undefined reference to `patlib::symQuadratic::myBasQ
uadratic() const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_12symQuadraticE+0x60): undefined reference to `typeinfo for patlib::symQuad
ratic'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_10symFinpathE+0x8): undefined reference to `typeinfo for patlib::symFinpath
'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_10symFinpathE+0x28): undefined reference to `patlib::symFinpath::myBasFinpa
th() const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_10symFinpathE+0x44): undefined reference to `typeinfo for patlib::symFinpat
h'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_8symCurveE+0x8): undefined reference to `typeinfo for patlib::symCurve'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_8symCurveE+0x18): undefined reference to `patlib::symCurve::myBasCurve() co
nst'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE4_NS_8symCurveE+0x40): undefined reference to `typeinfo for patlib::symCurve'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symCenteredE+0x20): undefined reference to `typeinfo for patlib::symCente
red'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symCenteredE+0x28): undefined reference to `patlib::symCentered::myBasCen
tered() const'
dseg.o(.gnu.linkonce.r._ZTCN6patlib7symDsegE0_NS_11symCenteredE+0x58): undefined reference to `typeinfo for patlib::symCente
red'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD1Ev+0xa): In function `patlib::symQuadratic::~symQuadratic [in-charge]()':
/home/spav/private/patmak/CO/quadratic.h:66: undefined reference to `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD1Ev+0x19):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD1Ev+0x29):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD1Ev+0x3d):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `VTT for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD1Ev+0x4f):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD0Ev+0xa): In function `patlib::symQuadratic::~symQuadratic [in-charge deleti
ng]()':
/home/spav/private/patmak/CO/quadratic.h:66: undefined reference to `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD0Ev+0x19):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD0Ev+0x29):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `vtable for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD0Ev+0x3d):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `VTT for patlib::symQuadratic'
dseg.o(.gnu.linkonce.t._ZN6patlib12symQuadraticD0Ev+0x4f):/home/spav/private/patmak/CO/quadratic.h:66: undefined reference t
o `patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0xa): In function `patlib::symStraight::~symStraight [in-charge]()':
/home/spav/private/patmak/CO/straight.h:62: undefined reference to `vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x19):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x29):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x31):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x43):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symLinear::~symLinear [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x5f):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x71):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x8a):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD1Ev+0x9c):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0xa): In function `patlib::symStraight::~symStraight [in-charge deleting]
()':
home/spav/private/patmak/CO/straight.h:62: undefined reference to `vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x19):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x29):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`vtable for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x31):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x43):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symLinear::~symLinear [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x5f):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x71):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x8a):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`VTT for patlib::symStraight'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD0Ev+0x9c):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib8symCurveD0Ev+0xa): In function `patlib::symCurve::~symCurve [in-charge deleting]()':
/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable for patlib::symCurve'
dseg.o(.gnu.linkonce.t._ZN6patlib8symCurveD0Ev+0x19):/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable
for patlib::symCurve'
dseg.o(.gnu.linkonce.t._ZN6patlib8symCurveD1Ev+0xa): In function `patlib::symCurve::~symCurve [in-charge]()':
/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable for patlib::symCurve'
dseg.o(.gnu.linkonce.t._ZN6patlib8symCurveD1Ev+0x19):/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable
for patlib::symCurve'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD0Ev+0xa): In function `patlib::symFinpath::~symFinpath [in-charge deleting]()'
:
/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD0Ev+0x19):/home/spav/private/patmak/CO/point.h:90: undefined reference to `vta
ble for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD0Ev+0x21):/home/spav/private/patmak/CO/point.h:90: undefined reference to `VTT
for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD1Ev+0xa): In function `patlib::symFinpath::~symFinpath [in-charge]()':
/home/spav/private/patmak/CO/point.h:90: undefined reference to `vtable for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD1Ev+0x19):/home/spav/private/patmak/CO/point.h:90: undefined reference to `vta
ble for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib10symFinpathD1Ev+0x21):/home/spav/private/patmak/CO/point.h:90: undefined reference to `VTT
for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib7symDsegD1Ev+0xf2): In function `patlib::symDseg::~symDseg [in-charge]()':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/iostream:60: undefined reference to `patlib::symCentered::~
symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib7symDsegD1Ev+0x11d):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/iostre
am:60: undefined reference to `patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib7symDsegD0Ev+0xf2): In function `patlib::symDseg::~symDseg [in-charge deleting]()':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/iostream:60: undefined reference to `patlib::symCentered::~
symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib7symDsegD0Ev+0x11d):/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/iostre
am:60: undefined reference to `patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.r._ZTIN6patlib7symDsegE+0x10): undefined reference to `typeinfo for patlib::symStraight'
dseg.o(.gnu.linkonce.r._ZTIN6patlib7symDsegE+0x18): undefined reference to `typeinfo for patlib::symFinpath'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD2Ev+0x51): In function `patlib::symStraight::~symStraight [not-in-charge]()':
/home/spav/private/patmak/CO/straight.h:62: undefined reference to `patlib::symLinear::~symLinear [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD2Ev+0x7d):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
dseg.o(.gnu.linkonce.t._ZN6patlib11symStraightD2Ev+0xa6):/home/spav/private/patmak/CO/straight.h:62: undefined reference to
`patlib::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.r._ZTVN6patlib7symLineE+0x78): undefined reference to `patlib::symInfpath::myBasInfpath() const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symStraightE+0x24): undefined reference to `typeinfo for patlib::symStrai
ght'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symStraightE+0x4c): undefined reference to `patlib::symStraight::myBasStr
aight() const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symStraightE+0x68): undefined reference to `typeinfo for patlib::symStrai
ght'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x24): undefined reference to `typeinfo for patlib::symLinear'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x30): undefined reference to `patlib::symLinear::~symLinear [i
n-charge]()'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x34): undefined reference to `patlib::symLinear::~symLinear [i
n-charge deleting]()'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x48): undefined reference to `patlib::symLinear::myBasLinear()
const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x64): undefined reference to `typeinfo for patlib::symLinear'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x68): undefined reference to `virtual thunk [v:0,-12] to patli
b::symLinear::~symLinear [in-charge]()'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_9symLinearE+0x6c): undefined reference to `virtual thunk [v:0,-12] to patli
b::symLinear::~symLinear [in-charge deleting]()'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_12symQuadraticE+0x24): undefined reference to `typeinfo for patlib::symQuad
ratic'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_12symQuadraticE+0x44): undefined reference to `patlib::symQuadratic::myBasQ
uadratic() const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_12symQuadraticE+0x60): undefined reference to `typeinfo for patlib::symQuad
ratic'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_10symInfpathE+0x8): undefined reference to `typeinfo for patlib::symInfpath
'line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_10symInfpathE+0x28): undefined reference to `patlib::symInfpath::myBasInfpa
th() const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_10symInfpathE+0x44): undefined reference to `typeinfo for patlib::symInfpat
h'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_8symCurveE+0x8): undefined reference to `typeinfo for patlib::symCurve'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_8symCurveE+0x18): undefined reference to `patlib::symCurve::myBasCurve() co
nst'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE4_NS_8symCurveE+0x40): undefined reference to `typeinfo for patlib::symCurve'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symCenteredE+0x20): undefined reference to `typeinfo for patlib::symCente
red'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symCenteredE+0x28): undefined reference to `patlib::symCentered::myBasCen
tered() const'
line.o(.gnu.linkonce.r._ZTCN6patlib7symLineE0_NS_11symCenteredE+0x58): undefined reference to `typeinfo for patlib::symCente
red'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD0Ev+0xa): In function `patlib::symInfpath::~symInfpath [in-charge deleting]()'
:
/home/spav/private/patmak/CO/line.h:78: undefined reference to `vtable for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD0Ev+0x19):/home/spav/private/patmak/CO/line.h:78: undefined reference to `vtab
le for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD0Ev+0x21):/home/spav/private/patmak/CO/line.h:78: undefined reference to `VTT
for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD1Ev+0xa): In function `patlib::symInfpath::~symInfpath [in-charge]()':
/home/spav/private/patmak/CO/line.h:78: undefined reference to `vtable for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD1Ev+0x19):/home/spav/private/patmak/CO/line.h:78: undefined reference to `vtab
le for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib10symInfpathD1Ev+0x21):/home/spav/private/patmak/CO/line.h:78: undefined reference to `VTT
for patlib::symInfpath'
line.o(.gnu.linkonce.t._ZN6patlib7symLineC1ERKS0_+0x171): In function `patlib::symLine::symLine[in-charge](patlib::symLine c
onst&)':
/home/spav/private/patmak/CO/line.cpp:56: undefined reference to `patlib::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.t._ZN6patlib7symLineD0Ev+0xf2): In function `patlib::symLine::~symLine [in-charge deleting]()':
/home/spav/private/patmak/CO/line.cpp:56: undefined reference to `patlib::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.t._ZN6patlib7symLineD0Ev+0x11d):/home/spav/private/patmak/CO/line.cpp:56: undefined reference to `patli
b::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.t._ZN6patlib7symLineD1Ev+0xf2): In function `patlib::symLine::~symLine [in-charge]()':
/home/spav/private/patmak/CO/line.cpp:56: undefined reference to `patlib::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.t._ZN6patlib7symLineD1Ev+0x11d):/home/spav/private/patmak/CO/line.cpp:56: undefined reference to `patli
b::symCentered::~symCentered [not-in-charge]()'
line.o(.gnu.linkonce.r._ZTIN6patlib7symLineE+0x10): undefined reference to `typeinfo for patlib::symStraight'
line.o(.gnu.linkonce.r._ZTIN6patlib7symLineE+0x18): undefined reference to `typeinfo for patlib::symInfpath'
point.o(.text+0x669): In function `patlib::symPoint::selfUpdate()':
/home/spav/private/patmak/CO/point.cpp:106: undefined reference to `typeinfo for patlib::symFinpath'
point.o(.gnu.linkonce.r._ZTVN6patlib8symPointE+0x10): undefined reference to `patlib::symCentered::myBasCentered() const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_9symRadialE+0x8): undefined reference to `typeinfo for patlib::symRadial'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_9symRadialE+0x10): undefined reference to `patlib::symCentered::myBasCent
ered() const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_9symRadialE+0x28): undefined reference to `patlib::symRadial::myBasRadial
() const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_9symRadialE+0x4c): undefined reference to `typeinfo for patlib::symRadial
'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_11symCenteredE+0x8): undefined reference to `typeinfo for patlib::symCent
ered'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_11symCenteredE+0x10): undefined reference to `patlib::symCentered::myBasC
entered() const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE0_NS_11symCenteredE+0x40): undefined reference to `typeinfo for patlib::symCen
tered'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_10symFinpathE+0x8): undefined reference to `typeinfo for patlib::symFinpa
th'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_10symFinpathE+0x28): undefined reference to `patlib::symFinpath::myBasFin
path() const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_10symFinpathE+0x44): undefined reference to `typeinfo for patlib::symFinp
ath'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_8symCurveE+0x8): undefined reference to `typeinfo for patlib::symCurve'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_8symCurveE+0x18): undefined reference to `patlib::symCurve::myBasCurve()
const'
point.o(.gnu.linkonce.r._ZTCN6patlib8symPointE4_NS_8symCurveE+0x40): undefined reference to `typeinfo for patlib::symCurve'
point.o(.gnu.linkonce.t._ZN6patlib9symRadialD1Ev+0xa): In function `patlib::symRadial::~symRadial [in-charge]()':
/home/spav/private/patmak/CO/radial.h:64: undefined reference to `vtable for patlib::symRadial'
point.o(.gnu.linkonce.t._ZN6patlib9symRadialD1Ev+0x19):/home/spav/private/patmak/CO/radial.h:64: undefined reference to `vta
ble for patlib::symRadial'
..... well, you get the idea...
Last edited by shabbychef; 09-02-2005 at 05:04 PM.
Are you compiling using g++ or gcc? If gcc, you should be using g++, which is the GNU C++ compiler. gcc is the C compiler and doesn't link any of the C++ libraries by default.
this is from my makefile. i use the same makefile stub in this dir and a subdir. i am able to get the subdir files compiled and executable. something else is going wrong here, i think....
Name mangling is what C++ does to functions to support overloaded functions, etc. It's basically the reason you usually need to define functions compiled as see using extern "C".
If you are usgin g++ throughout, it isn't likely the problem, it was just something I was speculating on because I was out of any other ideas...
Is the patlib namespace your own, or is that from another library that you maybe aren't including in the linker parameters?
Despite the way it sounds, "name-mangling" isn't really a bad thing. It just refers to the way a C++ compiler adds decorations to a function to uniquely identify it. About the only time it is a potential problem is when mixing C and C++. Since you are using a C++ compiler for each step, it shouldn't be a problem.
Are you using template classes at all? It doesn't appear so from the errors, but using templates can cause linker problems if you try to separate the implementation from the header like you usually do with normal classes. With templates, the compiler has to know the full implementation at the time it does each compilation unit, so you generally need to put the full implementation in the header.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.