• Advertisement
Sign in to follow this  

c++ SFML issue. Help!

This topic is 1666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

I figured out the problem.  I don't know if I can delete this so i'll just write solved at the top.  Thanks!

Share this post


Link to post
Share on other sites

Why don't you contribute to the community you're requesting assistance from by post your solution for other to learn from?

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
Sign in to follow this  

  • Advertisement