SFML community forums
Help => General => Topic started by: fetz on August 30, 2013, 01:00:45 am
-
Am getting this error: http://prntscr.com/1o7dpu
Here is the code i am using:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Am using Visual C++ 2010. Thankyou in advanced, Fetz
-
Are you mixing debug and release modes?
-
I too am having this/similar issue, although I'm using Visual Studio 2012 and can't get it to build or debug (same errors) I've read through the tutorial 4 times and even got my wife to check it in case I was going cross eyed :o
Here is how I've got everything set up, the console output can be seen at the bottom of the screen. It looks like I've not linked the sfml-graphics-d.lib file correctly is what I think is wrong...?
http://imgur.com/pMLmHPN (http://imgur.com/pMLmHPN) - Link to screen shot
-
I never tried to link in reverse order like that on visual 2008, 2010 or 2012 so I'm not sure but try linking system -> window -> graphics, and you don't need to link main if you have int main in your program.
-
Will try that now, when I didn't have the lib for main in there I had a huge list of issues... following the tutorial it says to start a windows application which expects Tmain (or some such) adding the main lib removed all bar those last two errors.
Edit: reversed order exactly the same error... :(
-
Apologies people, I was being silly!
I had specified a precompiler of SFML_STATIC but not linked the static library, changing them to sfml-xxx-s-d.lib fixed my problem.
Thanks for the fast response though! :-[