SFML community forums

Help => General => Topic started by: freesoul on September 22, 2012, 09:37:55 pm

Title: Using file streams. Help please.
Post by: freesoul on September 22, 2012, 09:37:55 pm
Hello, I'm using SFML for a little project I have. But now I need to manage data in binary files, if I include <iostream> or <fstream> i get conflict with SFML libraries. So my questions are:

- What header is FileStream declared in? Is it flexible to manage data structures?

- If i want to keep using plain standard headers without any wrapper, how I can do it? Can I namespace a single section of code?

Sorry if any of these questions can sound stupid. Thanks for help
Title: Re: Using file streams. Help please.
Post by: FRex on September 22, 2012, 09:46:03 pm
What is conflicting and how?
Title: Re: Using file streams. Help please.
Post by: freesoul on September 22, 2012, 11:34:07 pm
I've made a test project to make a class to manage my data using io streams from <fstream> and <iostream>, paralelly to my main project which uses SFML libs.

As these libs were in a general debug sheet (sfml debug graphics, window ,..), they were included in my test project, and when I compiled, I got a hundred errors conflicting with standard stream headers.

I deleted these libs from my test project, and it compiled fine, the problem is I will need to include this data class to my main project whose SFML libraries I can't delete, obviously

What I am doing wrong? :S

What is conflicting and how?

What: SFML  +  <fstream> / <iostream>
How: that's part of what I want to know  ;D
Title: Re: Using file streams. Help please.
Post by: FRex on September 22, 2012, 11:50:17 pm
Compiler and version, errors' texts, minimal code sample?
Title: Re: Using file streams. Help please.
Post by: kaB00M on September 23, 2012, 11:17:10 am
i use streams with no problems.

using namespace std; //don't use
using std::cout; //use this instead; etc.
 
Title: Re: Using file streams. Help please.
Post by: model76 on September 23, 2012, 07:06:20 pm
using namespace std;
That line was put in beginner tutorials by the devil himself, I am sure.  :(