SFML community forums

Help => General => Topic started by: netrick on August 17, 2012, 07:22:53 pm

Title: sf::RenderWindow very strange declaration error
Post by: netrick on August 17, 2012, 07:22:53 pm
So, well. I get error: 'sf::RenderWindow' has not been declared| in Logger.hpp.

Code of Logger.hpp:
Code: [Select]
#pragma once

#include <SFML/Window.hpp>
#include "Utilities.hpp"

class cLogger
{
private:
cUtilities utilities;
public:
cLogger(void);
~cLogger(void);
void write(string text, bool newline = true);
void write(int text, bool newline = true);
void write(double text, bool newline = true);
void write(float text, bool newline = true);
void start(bool deleting = false);
void error(sf::RenderWindow & window, string text); //error, sf::RenderWindow not declared.
        //is compilator blind or what?
void end();
};

And it may be something to do with "Utilities.hpp", so here's its code:
Code: [Select]
#pragma once

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;

class cUtilities
{
public:
string intToString(int variable);
string floatToString(float variable);
string doubleToString(double variable);
int stringToInt(string variable);
float stringToFloat(string variable);
double stringToDouble(string variable);
bool writeToFile(string name, const string & source, unsigned int type = 3);
bool loadFromFile(string & target, string name, bool binary = true);
int howMany(char character, string & target) const;
cUtilities(void);
~cUtilities(void);
};
In other files including Window.hpp and working with RenderWindow works perfectly. I don't understand it, where is the error?

Thanks
Title: Re: sf::RenderWindow very strange declaration error
Post by: Laurent on August 17, 2012, 07:25:03 pm
sf::RenderWindow is in sfml-graphics (SFML/Graphics.hpp).

Look: it's the first line of code which is shown in the RenderWindow tutorial (http://www.sfml-dev.org/tutorials/1.6/graphics-window.php).
Title: Re: sf::RenderWindow very strange declaration error
Post by: netrick on August 17, 2012, 07:29:40 pm
Oh my... Sorry, this thread can be deleted lol. Working on code for several hours in a row is very bad for logical thinking xD