Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::RenderWindow very strange declaration error  (Read 1410 times)

0 Members and 1 Guest are viewing this topic.

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
sf::RenderWindow very strange declaration error
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::RenderWindow very strange declaration error
« Reply #1 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.
Laurent Gomila - SFML developer

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: sf::RenderWindow very strange declaration error
« Reply #2 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