linking with mpatrol

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
asp
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sun Sep 12, 2004 4:35 pm

linking with mpatrol

Post by asp »

Hello,

I'm trying to debug my program with mpatrol, but I get this error when I try to link:

D:\mpatrol\1.4.8-mingw\build\mingw32\libmpatrol.a(cplus.o)(.text+0x440) In function `ZdlPv':
238 D:\mpatrol\1.4.8-mingw\src\cplus.c multiple definition of `operator delete(void*)'
/Dev-Cpp5/wxWindows-2.4.2/include/wx/msw/font.h D:\Dev-Cpp5\wxWindows-2.4.2\samples\minimal\minimal.o(.text$_ZdlPv+0x0):D first defined here
new_handler.cc D:\MinGW333\lib\libstdc++.a(new_handler.o)(.text+0x0) multiple definition of `std::set_new_handler(void (*)())'
74 D:\mpatrol\1.4.8-mingw\build\mingw32\libmpatrol.a(cplus.o)(.text+0x0):D:\mpatrol\1.4.8-mingw\src\cplus.c first defined here

This only happens when I am working with wxWidgets. If I compile a simple console "Hello world" program, then it works.

Any idea?
User avatar
Ryan Norton
wxWorld Domination!
wxWorld Domination!
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: linking with mpatrol

Post by Ryan Norton »

asp wrote:Hello,

I'm trying to debug my program with mpatrol, but I get this error when I try to link:

D:\mpatrol\1.4.8-mingw\build\mingw32\libmpatrol.a(cplus.o)(.text+0x440) In function `ZdlPv':
238 D:\mpatrol\1.4.8-mingw\src\cplus.c multiple definition of `operator delete(void*)'
/Dev-Cpp5/wxWindows-2.4.2/include/wx/msw/font.h D:\Dev-Cpp5\wxWindows-2.4.2\samples\minimal\minimal.o(.text$_ZdlPv+0x0):D first defined here
new_handler.cc D:\MinGW333\lib\libstdc++.a(new_handler.o)(.text+0x0) multiple definition of `std::set_new_handler(void (*)())'
74 D:\mpatrol\1.4.8-mingw\build\mingw32\libmpatrol.a(cplus.o)(.text+0x0):D:\mpatrol\1.4.8-mingw\src\cplus.c first defined here

This only happens when I am working with wxWidgets. If I compile a simple console "Hello world" program, then it works.

Any idea?
Sure - wx provides it's own memory tracing routines.

If you don't want those and want to use mpatrol instead, set
wxUSE_GLOBAL_MEMORY_OPERATORS to 0 when compiling wxWidgets.

(It _should_ work - in general it's probably a better idea to stick with wxWidget's version - see wx/memory.h for more info).
[Mostly retired moderator, still check in to clean up some stuff]
asp
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sun Sep 12, 2004 4:35 pm

Post by asp »

Thank you for your answer.

I have already set that flag to 0. Furthermore, setup.h says that memory tracing doesn't work with MinGW / CygWin. That's why I wanted to use mpatrol.
Post Reply