Thread: [Dev-C++] c/c++ and memory leak
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Fibre O. <fib...@go...> - 2005-07-17 04:03:31
|
Hi, does anyone tried to use MSS (http://hem.passagen.se/blizzar/mss/mssdoc.html) with Dev-cpp ??? I tried to compile this library but without success :-( I checked OpenWatcom & Digital Mars IDEs/compilers and I did not found any problem. Maybe someone from you knows how to use it with Dev-cpp ? BTW I am looking for good library to detect memory management problems i.e. memory leaks. Could someone of you you suggest good tool ??? Regards, Fibre Optic |
|
From: Josh M. <mrl...@gm...> - 2005-07-17 13:24:18
|
About the memory tool, this is my favourite. It's simple, easy, and all you need to do is include the header to use it. The output is extremely helpful as well. From the website: "Memory Manager (a.k.a. "MMGR") MMGR is an industrial-strength memory manager for almost any project. Not only will MMGR probably point out some bugs you never knew you had, but it is also a great development tool. Among other standard tracking tools (overruns/underruns, deallocation mismatches, etc.), MMGR also provides a rich featureset of developer tools. For example, it allows you to set a breakpoint on an arbitrary allocation, generate a snapshot report of memory currently in use, etc. You can even ask MMGR to track how much of your allocated RAM is actually in use (nothing worse than allocating 64MB of memory just to find that you only needed 2K. :)" http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_M= emory_Manager.zip Josh On 7/17/05, Fibre Optic <fib...@go...> wrote: > Hi, >=20 > does anyone tried to use MSS > (http://hem.passagen.se/blizzar/mss/mssdoc.html) with Dev-cpp ??? I > tried to compile this library but without success :-( I checked > OpenWatcom & Digital Mars IDEs/compilers and I did not found any > problem. Maybe someone from you knows how to use it with Dev-cpp ? >=20 > BTW >=20 > I am looking for good library to detect memory management problems i.e. > memory leaks. Could someone of you you suggest good tool ??? >=20 >=20 > Regards, > Fibre Optic >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclic= k > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Vale G. <val...@at...> - 2005-07-17 17:44:57
|
Mr. Optic - > does anyone tried to use MSS (http://hem.passagen.se/blizzar/mss/mssdoc.html) with Dev-cpp ??? I have both compiled it and used the library to analyze other programs. First of all, make sure that you have the latest version now hosted by SourceForge. (https://sourceforge.net/projects/libmss/) I even downloaded the source files from the CVS there to get some recent bug fixes. > I tried to compile this library but without success :-( I checked OpenWatcom & Digital Mars IDEs/compilers and I did not found any problem. Maybe someone from you knows how to use it with Dev-cpp ? Which compiler are you using with Dev-C++? I used Cygwin but I think MinGW also works. I've had some trouble with Borland version 5.6.4 and have submitted some bug reports for that. When compiling MSS, be sure to add -DMSS to the project C++ compiler command line. When using MSS in your own programs, add #include "c:\mss121\mss.h" to each source code .c or .cpp file. Chuck |
|
From: Fibre O. <fib...@go...> - 2005-07-17 18:36:48
|
Vale Group wrote:
>When compiling MSS, be sure to add
>
>-DMSS
>
>to the project C++ compiler command line.
>
>
>When using MSS in your own programs, add
>
>#include "c:\mss121\mss.h"
>
>to each source code .c or .cpp file.
>
>
>Chuck
>
>
>
fixed, i think ... One thing is wird for me :-( When I have commented
out '#include <mss.h>' all is OK. - mss log file is on place, looks good
- but if not I have such message from sompiler:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Projects\test\Makefile.win"
Executing make clean
rm -f main.o test.exe
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/Projects/mss121" -DMSS
main.cpp: In function `int main(int, char**)':
main.cpp:42: error: invalid conversion from `const char*' to `char*'
main.cpp:43: error: invalid conversion from `const char*' to `char*'
make.exe: *** [main.o] Error 1
Execution terminated
My simple, test code ise below::
//START
#include <iostream>
//#include <mss.h>
using namespace std;
int swap ( int inX, int inY )
{
int tmp;
tmp = inX;
inX = inY;
inY = tmp;
return 0;
}
int main(int argc, char *argv[])
{
int* x;
x = new int;
*x = 10;
int* y;
y = new int;
*y = 20;
for( int i = 0; i <= 100; i ++ ) {
cout << "Variable X: " << *x << endl;
cout << "Variable Y: " << *y << endl;
cout << "Swap variables ..." << endl;
swap( x, y );
cout << "Variable X: " << *x << endl;
cout << "Variable Y: " << *y << endl;
cout << endl;
}
delete x;
delete y;
system("PAUSE");
return EXIT_SUCCESS;
}
// STOP
Compilation log from Dev-cpp:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Projects\test\Makefile.win"
Executing make clean
rm -f main.o test.exe
g++.exe -D__DEBUG__ -c main.cpp -o main.o
-I"C:/Dev-Cpp/Projects/mss121" -DMSS
g++.exe -D__DEBUG__ main.o -o "test.exe" ../mss121/libmss.a
Execution terminated
Compilation successful
Regards,
Fibre Optic
|
|
From: Vale G. <val...@at...> - 2005-07-17 21:12:44
|
Fibre - > fixed, i think ... One thing is wird for me :-( When I have commented out '#include <mss.h>' all is OK. - mss log file is on place, looks good - but if not I have such message from sompiler: > main.cpp:42: error: invalid conversion from `const char*' to `char*' > main.cpp:43: error: invalid conversion from `const char*' to `char*' I also get the "invalid conversion" errors when I use the MinGW (default) compiler but not with a Cygwin (gcc) compiler. If I use the Cygwin compiler I can leave the '#include <mss.h>' statement in but then I have problems with the linker. This library obviously needs more work. Unfortunately, it is only maintained periodically and there are several fixes and a new release pending. Perhaps Lauren will get back to it some day soon. Chuck |