0

I'm using Xcode to build C++ Code where-in I'm calling delete to destroy memory, now I have a external lib loaded which has delete operator overloaded, so when I call delete the delete operator of lib is called even though I am not intended to do so.

Anybody has any clue how to prevent this?

I have found the decorated name for operator delete from the lib, but how would I tell Xcode about those symbols? If I define my own operator delete in my project my code doesn't compile because of the duplicate symbol error?

Anybody has any clue on this? Thanks in advance for the help.

Jay
  • 6,572
  • 3
  • 37
  • 65
Sarvesh
  • 33
  • 7
  • How did you come to the conclusion that an overloaded version of the operator is being called from _your_ code? The simple fact that it exists is not enough. – zneak Apr 05 '13 at 00:11
  • I had a stack trace, I observed it in instruments as well. – Sarvesh Apr 05 '13 at 00:17
  • Check this thread: http://stackoverflow.com/questions/2007274/a-library-forces-global-overloads-of-new-delete-on-me I'd probably try to play with namespaces. – cody Apr 05 '13 at 05:35
  • So you must derive from that class overriding the delete operator, right? – Jay Apr 05 '13 at 07:08
  • Or, is it possible you're linking a second C++ library against your Xcode project? – Jay Apr 05 '13 at 07:12
  • Yeah I m trying to use external dylib which has those operator defined in-it and I m linking that lib in my project. – Sarvesh Apr 05 '13 at 14:06

0 Answers0