473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

operators (f.e. new[]) undefined


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.
Aug 9 '05 #1
2 2394
Florian Xaver wrote:
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
Aug 9 '05 #2

Florian Xaver wrote:
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.

Aug 9 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Ioannis Vranos | last post by:
When we use the standard placement new operator provided in <new>, and not a definition of owr own, isn't a call to placement delete enough? Consider the code: #include <new>
4
by: GianGuz | last post by:
Global new and delete operators can be overloaded to suite particulars needs. Typically they are overloaded to insert useful debugging/trace informations. What I would to discuss here concerns the...
14
by: ambar.shome | last post by:
Hi, As you know there are few operators in C++ which cant be overloaded. They are: .., .*, ::, ?: , new , delete , sizeof , typeid , static_casr , dynamic_cast , const_cast ,...
2
by: Shark | last post by:
Hi, if we need to change the behavior of operator new, it is called overriding or overloading? My other question is, if we change the behavior of operator new, do we use malloc to do that or we use...
3
by: Alexander Ubillus | last post by:
Hello, I'm reading this book (Self-Paced for 70-536) where it says that operators are new both to VB:NET and C#. As far as i know operators exist for C# since 1.x and this link says so too: ...
3
by: Lighter | last post by:
The C++ Standard Doesn't Permit Overloading new and delete? In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find the specification on overloading the operators new and delete;...
4
by: moleskyca1 | last post by:
What operators cannot be virtual and why? I looked at FAQ and found nothing. I think there are operators that cannot be virtual, but I don't know why?
1
by: dilabox | last post by:
Hello, I have overloaded the global new, delete, new and delete operators inside a "static library". The library uses private memory allocation routines that must not be accessible from other...
3
by: C++Liliput | last post by:
Hi, I was looking at the implementation of operator new and operator new in gcc source code and found that the implementation is exactly the same. The only difference is that the size_t argument...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.