Help! VC6: debug linking problem!
I have been compiling my game in release mode since I started it, and now I can''t get it compile in debug mode. I really need the debug mode to locate a memory leak I have somewhere.
The problem is that I don''t know what libs I need in the program to get it compile in debug mode. In release mode it compiles alright but if I compile in debug mode, I get these errors:
Linking...
getlevels.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ)
getlevels.obj : error LNK2001: unresolved external symbol "public: int __thiscall CFileFind::IsDirectory(void)const " (?IsDirectory@CFileFind@@QBEHXZ)
libcid.lib(ifstream.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int,int,char const *,int)" (??2@YAPAXIHPBDH@Z)
libcid.lib(_ios.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int,int,char const *,int)" (??2@YAPAXIHPBDH@Z)
libcid.lib(filebuf1.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int,int,char const *,int)" (??2@YAPAXIHPBDH@Z)
libcid.lib(streamb.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int,int,char const *,int)" (??2@YAPAXIHPBDH@Z)
Debug/TOU.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
That getlevels.obj is from my getlevels.cpp, but I have no idea what the other things mean. So how to get rid of all those errors? Should I use the libs I have in different order or include/exclude some libs?
Thanks in advance!
-Hans [home page] [e-mail]
The problem is because you are prototyping (or including headers that prototype''s) functions, but the linker cannot find the function implementations because you dont link with the libraries that contain the function implementations.
Make sure you are linking with the same libraries as in release mode. Try pressing the "Reset" button (project->settings->link). Maybe that would help.
Hope this helps you.
-René
Make sure you are linking with the same libraries as in release mode. Try pressing the "Reset" button (project->settings->link). Maybe that would help.
Hope this helps you.
-René
I tried that but it didn''t work. Instead, after spending quite a time I noticed that in
Project settings->C/C++
where at the bottom are the compiler parameters,
they look something like this in debug mode:
/nologo /MLd /Gm /GX /ZI /Od /D "WIN32" /D....
but if I change it to
/nologo /ML /Gm /GX /ZI /Od /D "WIN32" /D....
I get no linker errors at all! Strange. What does that /MLd do?
However, I still have one problem. I use DirectDraw exclusive mode in the game, so if I try to debug (F5) and the program crashes, the Windows can''t have control to the screen any more. So when the game crashes I only get a black screen in debug mode.
But I can now use try{},catch{}-system to debug, and it is maybe enough for me.
-Hans [home page] [e-mail]
Project settings->C/C++
where at the bottom are the compiler parameters,
they look something like this in debug mode:
/nologo /MLd /Gm /GX /ZI /Od /D "WIN32" /D....
but if I change it to
/nologo /ML /Gm /GX /ZI /Od /D "WIN32" /D....
I get no linker errors at all! Strange. What does that /MLd do?
However, I still have one problem. I use DirectDraw exclusive mode in the game, so if I try to debug (F5) and the program crashes, the Windows can''t have control to the screen any more. So when the game crashes I only get a black screen in debug mode.
But I can now use try{},catch{}-system to debug, and it is maybe enough for me.
-Hans [home page] [e-mail]
When developing your game, you should try using windowed mode. That''s alot easier when debuging. But that try/catch thing is probably fine too. I have never used it, cause i dont know what it is ...
About that /ML switch you should try to look at this site. It''s a list of all compiler switches that VC++ use.
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_compiler_reference.htm
Hope this helps.
-René
About that /ML switch you should try to look at this site. It''s a list of all compiler switches that VC++ use.
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_compiler_reference.htm
Hope this helps.
-René
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement