operators (f.e. new[]) undefined

F

Florian Xaver

Hi!

I got the following errors from the linker (using latest version of
DJGPP and gcc/gpp). But, why are the operators
undefined????
Any ideas?


.../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x120): undefined
reference t
o `operator new[](unsigned long)'
.../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x18c): undefined
reference t
o `operator delete(void*)'
.../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x2f6): undefined
reference t
o `operator new[](unsigned long)'
.../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x432): undefined
reference t
o `operator delete(void*)'
.../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.eh_frame+0x11): undefined
referenc
e to `___gxx_personality_v0'

I can compile libsword.a without problems. But if i want to use it, i
got this errors.


Thanks, Flo

PS: DJGPP is the DOS-port of the Gnu Compilers.
 
V

Victor Bazarov

Florian said:
I got the following errors from the linker (using latest version of
DJGPP and gcc/gpp). But, why are the operators
undefined????
Any ideas?

(a) You didn't define them.

(b) You defined them but didn't supply the source where they are defined
to the compiler.

(c) You defined them, compiled the source, but never gave the object file
to the linker.

(d) They are not for you to define because they are part of the standard
library (although they don't seem to be), but you didn't tell the
linker where to find that library.

Choose the one that fits your situation.
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x120): undefined
reference t
o `operator new[](unsigned long)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x18c): undefined
reference t
o `operator delete(void*)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x2f6): undefined
reference t
o `operator new[](unsigned long)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x432): undefined
reference t
o `operator delete(void*)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.eh_frame+0x11): undefined
referenc
e to `___gxx_personality_v0'

I can compile libsword.a without problems. But if i want to use it, i
got this errors.


Thanks, Flo

PS: DJGPP is the DOS-port of the Gnu Compilers.

In comp.lang.c++ it matters not. If you need help on a particular
compiler, consider posting to that compiler's newsgroup (gnu.g++.help).

V
 
A

Alipha

Florian said:
Hi!

I got the following errors from the linker (using latest version of
DJGPP and gcc/gpp). But, why are the operators
undefined????
Any ideas?


../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x120): undefined
reference t
o `operator new[](unsigned long)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x18c): undefined
reference t
o `operator delete(void*)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x2f6): undefined
reference t
o `operator new[](unsigned long)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.text+0x432): undefined
reference t
o `operator delete(void*)'
../../lib/djgpp.v2/libSWORD.a(spy.o):spy.cc:(.eh_frame+0x11): undefined
referenc
e to `___gxx_personality_v0'

I can compile libsword.a without problems. But if i want to use it, i
got this errors.


Thanks, Flo

PS: DJGPP is the DOS-port of the Gnu Compilers.

make sure you are always using g++ and not gcc. both compile c++, but
g++ links the appropriate c++ libraries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top