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

Author Topic: SFML Linker error vs 2010  (Read 3744 times)

0 Members and 1 Guest are viewing this topic.

RedShift

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML Linker error vs 2010
« 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;
}

RedShift

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML Linker error vs 2010
« Reply #1 on: January 10, 2012, 04:12:54 am »
Got it working.

Atomical

  • Newbie
  • *
  • Posts: 12
    • View Profile
SFML Linker error vs 2010
« Reply #2 on: January 11, 2012, 05:49:10 pm »
You forgot to link to the lib files?

gl0w

  • Newbie
  • *
  • Posts: 20
    • View Profile
SFML Linker error vs 2010
« Reply #3 on: January 11, 2012, 07:51:17 pm »
Could you explain how you fix it?

thanks

RedShift

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML Linker error vs 2010
« Reply #4 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

 

anything