Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Memory Leaks

Author
Message
Brillig
16
Years of Service
User Offline
Joined: 19th May 2008
Location:
Posted: 3rd Nov 2009 07:01
Anyone have a good way of debugging memory leaks within a DarkGDK application in Visual C++? I've tried a bunch of options tonight, and the only one that worked for me was http://www.runtimechecker.com/ and it costs 70 bucks to buy.

This one did nothing at all when I included it in my project (and defined _DEBUG): http://dmoulding.googlepages.com/downloads

Same with this one (no prints or anything even when I inserted a memory leak): http://www.gamedev.net/community/forums/topic.asp?topic_id=482850

I got linker errors when I tried to use this: http://www.codeguru.com/forum/showthread.php?t=312742
Bruce Dudeson
15
Years of Service
User Offline
Joined: 17th Mar 2009
Location:
Posted: 3rd Nov 2009 08:22
I use the memory leak detection in Visual Studio you can find information on it here:
http://msdn.microsoft.com/en-us/library/e5ewb1h3%28VS.80%29.aspx
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 3rd Nov 2009 14:42
I prefer http://www.codeproject.com/KB/applications/visualleakdetector.aspx.
Free, easy to use, and useful enough.

if(asleep) sheep++;
Brillig
16
Years of Service
User Offline
Joined: 19th May 2008
Location:
Posted: 5th Nov 2009 00:15
Hey guys, thanks for suggesting some tools.

@Bruce - I tried using this solution by opening a new darkgdk project and following the steps in the link you sent, but I get a linker error:

Main.obj : error LNK2019: unresolved external symbol __CrtDumpMemoryLeaks referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
Debug\MemoryLeakTest.exe : fatal error LNK1120: 1 unresolved externals

I attached my project. If you get a sec, will you please take a peek at the code and se if there's something else I need to do to get it to work?

Attachments

Login to view attachments
Brillig
16
Years of Service
User Offline
Joined: 19th May 2008
Location:
Posted: 5th Nov 2009 00:36
@Drowneath I get a similar problem with the visual leak detector tool. From a new darkGDK 3D game, I downloaded 1.0, put the files into the visual studio installation in the right places, and included "vld.h." It found the header but couldn't link. Do you need to do anything special to make it work with darkGDK? Here are the errors I got:

vldmt.lib(vld.obj) : error LNK2019: unresolved external symbol __CrtSetAllocHook referenced in function "public: __thiscall VisualLeakDetector::VisualLeakDetector(void)" (??0VisualLeakDetector@@QAE@XZ)
vldmt.lib(vld.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "public: __thiscall VisualLeakDetector::VisualLeakDetector(void)" (??0VisualLeakDetector@@QAE@XZ)
vldmt.lib(vldutil.obj) : error LNK2001: unresolved external symbol __malloc_dbg
vldmt.lib(vld.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,char *,int)" (??3@YAXPAXPADH@Z)
vldmt.lib(vldutil.obj) : error LNK2001: unresolved external symbol __free_dbg
Debug\VldLeakTest.exe : fatal error LNK1120: 3 unresolved externals

Login to post a reply

Server time is: 2024-11-20 11:46:48
Your offset time is: 2024-11-20 11:46:48