Sign in to follow this  
drakogate

c++ SFML issue. Help!

Recommended Posts

****SOLVED****

 

Okay, so I just installed SFML on Visual C++ and i'm working some tutorials and whatnot.  Anyways i'm having a big problem.  Here's my code.

 

// Libraries
#include <SFML/Window.hpp>
#include <iostream>
using namespace sf;
using namespace std;
 
// Global variable, functions, classes
 
 
int main()
{
//Create the window parameters
sf::RenderWindow window(VideoMode(800, 600), "Grole");
//(FPS = NUMBER OF TIMES GAME USUALLY LOOPS.  NORMALLY 60 FPS)
window.setFramerateLimit(60); //Game loop will repeat 60 times per second
 
 
bool running = true;
 
//Game loop (infinite loop that reapeats until user decides to close game.
while (running == true)
{
 
//EVENTS
Event event;
//Check all events that are happening in between each frame
while (window.pollEvent(event))
{
 
}
 
//LOGIC
 
 
//RENDERING
window.clear();
 
window.display();
}
 
//////////////
 
//Clean up
window.close();
 
return 0;
 
}

 

 

 

When I use sf::RenderWindow my compiler tells me "Error: namespace "sf" has no member "RenderWindow".  Anyone know how to solve this problem?  

 

Thanks!

Edited by drakogate

Share this post


Link to post
Share on other sites

 

// Libraries

#include <SFML/Window.hpp>
#include <iostream>

 

Needed to change this bit of code to:

 

 

#include <SFML/Graphics.hpp>

#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <iostream>

 

Never really used this kind of forum.  Sorry about that.  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this