473,327 Members | 1,920 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,327 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 35299
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.