SFML community forums

Help => General => Topic started by: RedShift on January 10, 2012, 01:37:58 am

Title: SFML Linker error vs 2010
Post by: RedShift on January 10, 2012, 01:37:58 am
Hey guys,
I'm trying to get SFML working on VS 2010 but i'm having problems with the compiler giving linker errors. I'm just trying to run a blank window to check everything is setup fine.

The odd thing is, if I include and run the code for the command line clock, I don't get any linker errors. However, when I try to create a blank window by including SFML/Window.hpp I am getting linker errors.

Are there any tutorials that cover SFML setup with VS 2010 that go through making a blank window?

The odd thing is, using the sf:: scope operator autocomplete recognizes the funtions that return linker errors. There must be something I did wrong with the project setup or files.

Any ideas?

Here is the code too:

Code: [Select]

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

int main()
{
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML");

sf::Event Event;

while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}

Game.Clear();

Game.Display();
}

return EXIT_SUCCESS;
}
Title: SFML Linker error vs 2010
Post by: RedShift on January 10, 2012, 04:12:54 am
Got it working.
Title: SFML Linker error vs 2010
Post by: Atomical on January 11, 2012, 05:49:10 pm
You forgot to link to the lib files?
Title: SFML Linker error vs 2010
Post by: gl0w on January 11, 2012, 07:51:17 pm
Could you explain how you fix it?

thanks
Title: SFML Linker error vs 2010
Post by: RedShift on January 12, 2012, 06:24:21 am
I forgot to add all of the dependencies. Here is a helpful tutorial that worked for me:

http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-1.aspx