File Streaming with SDL

When I try to use fstream, or any functions such as file reading /
writing, I can’t compile when using SDL. What methods of file reading /
writing should I use with SDL? I’m running WinXP and using Microsoft
Visual C++ 6.0. Any example code would be greatly appreciated.

Colin Hart wrote:

When I try to use fstream, or any functions such as file reading /
writing, I can’t compile when using SDL. What methods of file reading
/ writing should I use with SDL? I’m running WinXP and using Microsoft
Visual C++ 6.0. Any example code would be greatly appreciated.

I happily use both C++ style (iostream) and C style (FILE*) streams with
SDL in Visual C++ 6.0 with no problems. SDL should have no effect on
file I/O operations, and certainly not during compilation. Perhaps you
could share your exact compilation errors?–
Kylotan
http://pages.eidosnet.co.uk/kylotan

When I try to use fstream, or any functions such as file reading /
writing, I can’t compile when using SDL. What methods of file reading /
writing should I use with SDL? I’m running WinXP and using Microsoft
Visual C++ 6.0. Any example code would be greatly appreciated.

Project -> Settings… -> Link -> General
check "Ignore all default libraries"
Object/Library modules:
kernel32.lib SDL/Win32/SDL.lib SDL/Win32/SDLmain.lib msvcrt.lib
add any extra library used from you

much lost time for this!..

Code? Take this!.. (nothing special)------------------
#include "SDL/SDL.h"
int main(int argc, char* argv[])
{
ShellInit(); //mine
while(1)
{
MessageLoop(); // mine
DrawScene(); //mine
SDL_GL_SwapBuffers();
}
ShellDestroy(); //mine
}

Beware; if you do this instead of actually fixing it (making your CRT
settings match), you may encounter obscure problems down the line.
(Changing the CRT settings changes some preprocessor defs, and changes
some things in the C headers.)On Tue, Feb 04, 2003 at 10:08:53PM +0200, <- Chameleon -> wrote:

When I try to use fstream, or any functions such as file reading /
writing, I can’t compile when using SDL. What methods of file reading /
writing should I use with SDL? I’m running WinXP and using Microsoft
Visual C++ 6.0. Any example code would be greatly appreciated.

Project -> Settings… -> Link -> General
check "Ignore all default libraries"
Object/Library modules:
kernel32.lib SDL/Win32/SDL.lib SDL/Win32/SDLmain.lib msvcrt.lib
add any extra library used from you


Glenn Maynard

Beware; if you do this instead of actually fixing it…

Fixing it? How? With change in SDL source?

Your CRT settings (“code generation -> runtime library”) have to match
with the libraries you use, or it’ll try to pull in two or more
runtimes.On Tue, Feb 04, 2003 at 10:30:03PM +0200, <- Chameleon -> wrote:

Beware; if you do this instead of actually fixing it…

Fixing it? How? With change in SDL source?


Glenn Maynard