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 / Unable to use STLs when using DGDK

Author
Message
Justin AnyhowStep
13
Years of Service
User Offline
Joined: 17th Jul 2011
Location: Use of uninitialized variable
Posted: 12th Sep 2011 03:31
I've had this problem for quite a while and I'm at my limit, haha.
I'm using VS2008 because DGDK doesn't work for VS2010.

Anyways, in normal projects, I can use the STLs like string, stack, vector, queue, etc. but in DGDK projects, I get error messages.

I can use the STLS in my main.cpp for some reason.


But in anything other than the main.cpp, I get errors:


I'm guessing it's because nothing "includes" or depends on main.cpp so it's the only thing that can use STLs but I don't get "Why" or how to fix this =/

Anyone know what's going on?
I've even had to learn how to work with C-style strings because I can't access the library "string" =(
Not to say that it was a bad learning experience but I'd rather code my game for now.

First year student of a game-programming course
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 12th Sep 2011 05:17 Edited at: 12th Sep 2011 05:19
You need to set your project to "multi-threaded runtime" in the project settings under the "C++" tab, then it will work.

EDIT: You may need to prefix the commands with std.
EXAMPLE:
Justin AnyhowStep
13
Years of Service
User Offline
Joined: 17th Jul 2011
Location: Use of uninitialized variable
Posted: 12th Sep 2011 10:09
Oh, my-
Namespace!
I cannot believe I let that slip past my mind.
What the devil was I thinking?

I still find it weird that it works in main.cpp when I didn't use the line "using namespace std;" or the "std::" prefix but at least it works now.

Thank you very much

First year student of a game-programming course

Login to post a reply

Server time is: 2024-11-19 08:47:50
Your offset time is: 2024-11-19 08:47:50