473,405 Members | 2,167 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,405 software developers and data experts.

undefined reference to "operator new" and "operator delete"

365 100+
I compiled tinyxml files (.cpp files) and when I am linking to create final exe in Linux, I am getting lot of errors saying "undefiend reference" to "operator new" and "delete", any idea?.


Main.cpp:377: undefined reference to `operator delete[](void*)'
tinyXML/include/tinystr.h:259: undefined reference to `operator delete[](void*)'
../common/tinyXML/include/tinyxml.h:1401: undefined reference to `operator delete[](void*)'
../common/tinyXML/include/tinystr.h:259: undefined reference to `operator delete[](void*)'
/opt/lib/libtinyxml.a(tinystr.o)(.text+0x83):tinyXML/tinystr.h:242: undefined reference to `operator new[](unsigned)'

/opt/lib/libtinyxml.a(tinystr.o)(.text+0xb7):tinyXML/tinystr.h:259: undefined reference to `operator delete[](void*)'

/opt/lib/libtinyxml.a(tinystr.o)(.text+0x14f):tinyXML/tinystr.h:242: undefined reference to `operator new[](unsigned)'
/opt/lib/libtinyxml.a(tinystr.o)(.text+0x19a):tinyXML/tinystr.h:259: undefined reference to `operator delete[](void*)'
Dec 1 '09 #1
3 35458
whodgson
542 512MB
I don`t know anything about linux but it sounds as though you are missing the include file which defines the new and delete operators, like #include<iostream> in the environment I work in. I`ll be interested to see what the experts say.
Dec 2 '09 #2
tvnaidu
365 100+
I did include #include <iostream> in all .cpp files, but it didn't help, any other clue?.
Dec 2 '09 #3
tvnaidu
365 100+
Found the issue: I need to pass -lstdc++ during linking, those errors gone, couple of more for shared libs.
Dec 2 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Mysooru | last post by:
How to restrict an object to be instantiated only using new operator? I mean, one should not be allowed to create an object like AnObject obj; it should be AnObject obj = new AnObject;
16
by: garyolsen | last post by:
For a class, MyClass, there are two ways to instantiate an object: 1. MyClass *MC = new MyClass(); 2. MyClass MC; In general, when should you have to use 1 and when 2? What're...
30
by: seesaw | last post by:
Is it right thing to always avoid using "new" to create objects? What if after starting the application, then decide which and how many objects to create? (Seems like under such situation is there...
24
by: Rv5 | last post by:
Rookie c++ question, but Ive spent the last 5 years doing Java, where everytime I created an object I used new. In c++ I can create my objects without and its confusing me just a little. I have...
6
by: CodeCracker | last post by:
class A { public: A(obj &objRef): mObj(objRef) { } ~A() { delete &mObj; } private: Obj &mObj; }
1
by: sven_c_t | last post by:
Hi! Probably a newbie question. I´ve been working a bit with the widget toolkit FLTK and I have been wondering why there is such a heavy use of the new operator, when it does not seem to be...
5
by: mkaushik | last post by:
Hi everyone, Im just starting out with C++, and am curious to know how "delete <pointer>", knows about the number of memory locations to free. I read somewhere that delete frees up space...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.