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 / Can't run my project in Debug mode.

Author
Message
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 23rd Jan 2008 13:26
I don't understand this. My project runs fine in Release mode, but when i run it in Multi Threaded Debug mode, it throws a lot of errors:



The relevant (i think) options are:
Runtime Library - Multi-threaded Debug (/MTd)
Linker : Ignore Specific Library - msvcrt, libcmtd, atls

This is driving me insane. Does anyone have a solution?
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 23rd Jan 2008 15:31 Edited at: 23rd Jan 2008 15:37
Just go into your projects 'debug' configuration settings and change the runtime setting from /MTd to /MT

Project->Properties->Code Generation->Runtime Library Multi-threaded (/MT)

Both the release and debug runtime library settings need to be /MT as TGC have not provided a debug version of the GDK library.

[EDIT]
This at least gives you some debug capability!

No matter how good your code is, someone will improve on it
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 23rd Jan 2008 21:40
On the example projects they even use the MTD library. Why can't I? I can't even set breakpoints in MT.
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 24th Jan 2008 01:25
Yes, it is confusing.

In the Dark GDK templates they set the following in the Debug Configuration:

Runtime Library - Multi-threaded Debug (/MTd)

which statically links the libcmtd.lib runtime library which is a debug version of the libcmt library. This is perfectly correct for debug builds apart from the fact that we are then statically linking in a release version of the DGDK library which has been statically linked against the libcmt.lib library.

These two libraries are not compatable you start to see linker errors complaining about definitions in one library already defined in the other.

So what TGC appear to have done is exclude the debug runtime with the following setting in the linker:

Ignore Specific Library - msvcrt, libcmtd, atls

which appears to work until you do something like include a standard library header e.g.

#include <string>

This then causes the linker to statically link to the libcpmt.lib library and back come the linker errors.

IMHO when linking to a static release library the runtime library should never be set to /MTd beacuse you are asking for trouble.
Set it to /MT instead.

So long as you have the following setting:

Linker->Debugging->GenerateDebugInfo = YES(/DEBUG)

then you should have debug capability including being able to set breakpoints, just ensure you are running your program in a window and not full screen. You will not be able to debug within the linked libraries, only in your own code.

Of course, the ideal would be for TGC to release a debug version of the DGDK library allowing us to use the /MTd setting with full debug capability. It does however mean you have to link to the appropriate library dependent on the type of build you are doing.

Hope this helps!

No matter how good your code is, someone will improve on it
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 24th Jan 2008 07:55
Hmm - well I set everything how you said, but I still go back to my original problem. The breakpoint I set, when my program is executed, says "This breakpoint will not currently be hit. No symbols have been loaded for this document."

Googling this error pretty much tells me to take it out of release mode and put it into debug mode.

Any ideas then?
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 24th Jan 2008 10:01
None, other than checking all your debug related settings in the project configuration. I have never come accross this error before.

Did you start with a Dark GDK template generated project?

Are you linking to any other libraries directly other than the DGDK lib?

Guess you might have to wait for someone who has come accross this to offer advice, or start with a fresh project and copy your code accross.

Good luck!

No matter how good your code is, someone will improve on it
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 24th Jan 2008 10:06
Ugh..it looks like the fact that my project is set to release is what is not allowing me to set breakpoints. In the dark invaders tutorial, I can set breakpoints, but that's because it's set to debug. If I add <string>, it breaks, so I must set it to release, which leaves me with no breakpoints. It seems I cannot meet a compromise.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 24th Jan 2008 10:55
This may seem like a stupid question, and more than likely is!

But once you have set the runtime library to (MT) have you set the build to DEBUG

Who is your Daddy, and what does he do?
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 25th Jan 2008 02:57
Ok, but when I do that, I get the errors in my original post.
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 25th Jan 2008 10:26
I would put money on the fact that you still have the project's debug configuration runtime library setting set to /MTd, otherwise it would not be trying to link to the libcpmtd library!!!

When you make changes to the project's config are you ensuring its set to DEBUG first?

No matter how good your code is, someone will improve on it
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 25th Jan 2008 23:09
Here are all my settings. I hope something is wrong so I can fix it.





Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 26th Jan 2008 00:48
Thanks for posting the screen shots. I can see nothing wrong with the settings you have. However, something is clearly still causing it to try and link the libcpmtd.lib library which is a debug library and the cause of your problems.

I'm wondering if you have any prebuilt objects which are not getting rebuilt. Can you try the menu option Build - Clean Solution followed by Build - Rebuild Solution.


If this doesn't cure it then could you do the following:

Paste the config compiler command line and the config linker command line so I can see all your project settings.

Also, do you have any 'pragma' lines in your code referencing libraries?

Are you using any other external libraries apart from DarkGDK?

I must admit I'm probably as confused about this as you now! I can easily reproduce most of your linker errors in my projects by just setting the Debug Config runtime setting to /MTd, but you clearly don't have that set!

It might be time to create a brand new empty project based on the 3D Game template and change the Debug config runtime setting to /MT and migrate your code into this project.

Although I have found no problems so far with C++ 2008, I did have some weird problems in 2005 where sometimes introducing Std Library calls broke the project causing linker errors like this, the only way I could fix them was to create a new project.

No matter how good your code is, someone will improve on it
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 26th Jan 2008 05:25
Cleaning/Rebuilding did not work.

Compiler:


Linker:


Yes, I use #pragma once at the top of all my headers.
No, I am not using any other external libraries.
I do use <string> so maybe i have that problem.
ryeguy
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 30th Jan 2008 07:59
Anyone else have any ideas?

Login to post a reply

Server time is: 2024-05-09 00:11:43
Your offset time is: 2024-05-09 00:11:43