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 / Using fstream

Author
Message
mikeMarek 597
15
Years of Service
User Offline
Joined: 12th Feb 2009
Location:
Posted: 25th Apr 2009 00:01
How can I use fstream commands in a DarkGDK project? Whenever I include the file, I get an error. How can I do this?

Thanks,
-Mike
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Apr 2009 01:08 Edited at: 25th Apr 2009 01:08
I would do it like this:


mikeMarek 597
15
Years of Service
User Offline
Joined: 12th Feb 2009
Location:
Posted: 25th Apr 2009 01:22
Sorry heyufool1, but it says that the file does not exist. And when I try using fstream instead of fstream.h, I get an error saying I have unresolved externals. This also happens when using angle brackets to include the file, as well as quotes.
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Apr 2009 06:15
You have to change filename to the name of the file that you are inputing from and it's suppose to be #include "fstream.h".
put this line right under the #include "DarkGDK.h":


then to input from the file do this:


prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 25th Apr 2009 12:13
try
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Apr 2009 18:41
Isn't iostream for console input? And i'm using fstream to input from a text file for my game. My full include list is this:


prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 25th Apr 2009 18:53
Use "#include <fstream>" (without the .h) because with the .h, it has been depreciated and the only reason it works is that VC++ allows it, but probably at a later date it will be removed
mikeMarek 597
15
Years of Service
User Offline
Joined: 12th Feb 2009
Location:
Posted: 26th Apr 2009 23:54
I tried both #include "fstream" and #include <fstream>, but I always get the same error message:

Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 27th Apr 2009 00:23
Change Runtime Library to "/MT" or compile in release mode.

Project Property's -> C/C++ -> Code Generation -> Runtime Library

Login to post a reply

Server time is: 2024-09-30 23:24:00
Your offset time is: 2024-09-30 23:24:00