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 / Strings and DarkGDK

Author
Message
archie456
16
Years of Service
User Offline
Joined: 13th Feb 2008
Location:
Posted: 4th Mar 2008 21:52
Hi,

When I put #include <string> at the top of my programme I get a compile error;



Does this not work with DarkGDK?

Also, I've noticed that if I use the statement 'use namespace std' I get errors - So I cannot use this either?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 4th Mar 2008 22:38
This may go hand in hand with a problem I ran into today. The built-in file functions don't do it for me in that I need to write out something as a bag of bits of a specific size and read them back in. I tried to create an ofstream object but every time I included the <fstream> headers I got essentially the same errors. I suspect that the way GDK takes over and implements the main() function causes a conflict somewhere with the standard libraries. Hopefully there's a way to bypass them or use them through what's given us. Otherwise I'm going to have to implement my levels in pseudo-XML, which leaves them open to tampering.

Lilith, Night Butterfly
archie456
16
Years of Service
User Offline
Joined: 13th Feb 2008
Location:
Posted: 4th Mar 2008 22:48
I found a post which sorted out the problem.

You need to click on the project and select properties, then go down to c/c++ and then select 'Code Generation'.

Pick the runtime library and change it to 'Multi-threaded (/MT)'

No idea of what this does, but it allows you to use the string header...
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 5th Mar 2008 18:36
Quote: "I found a post which sorted out the problem.

You need to click on the project and select properties, then go down to c/c++ and then select 'Code Generation'.

Pick the runtime library and change it to 'Multi-threaded (/MT)'

No idea of what this does, but it allows you to use the string header..."



I did some investigation after having discussed this on another thread. What I found was that it only happens in a Debug build. A Release build doesn't experience the same problem. What your solution does is tells the linker to use the non-debug multi-threading module, which apparently doesn't have the same problem, even if the rest of your code still carries the debug information. As long as you don't have to debug multi-threaded code this is okay.

Lilith, Night Butterfly
archie456
16
Years of Service
User Offline
Joined: 13th Feb 2008
Location:
Posted: 5th Mar 2008 21:18
Any idea on my second question:

I've noticed that if I use the statement 'use namespace std' I get errors - So I cannot use this either?

This means that if I use the string header I just have to use std::string.

This isn't really a problem - but I like to know why it doesn't work with DarkGDK

Login to post a reply

Server time is: 2024-11-20 03:42:18
Your offset time is: 2024-11-20 03:42:18