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

Author Topic: Linking error (I believe). Need help.  (Read 1299 times)

0 Members and 1 Guest are viewing this topic.

imnota4

  • Newbie
  • *
  • Posts: 1
    • View Profile
Linking error (I believe). Need help.
« on: January 26, 2015, 08:39:48 pm »
I'm trying to get SFML 2.2 to work on codeblocks, however I can't seem to get it to work.

I'm running the sample code given, I follow the tutorial on the website, as well as multiple others to be sure I was doing it correctly. I have no clue why it's not working. I'm also confused as to why it's references a directory in my computer that doesn't exist.

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow win(sf::VideoMode(200, 200), "SFML Test");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (win.isOpen())
    {
        sf::Event event;
        while (win.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
            {
                win.close();
            }
        }

        win.clear();
        win.draw(shape);
        win.display();
    }

    return 0;
}
 

Added the error message as an attachment, as well as my linker settings.

math1992

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
    • Email
Re: Linking error (I believe). Need help.
« Reply #1 on: January 26, 2015, 11:05:27 pm »
You entered the libraries in the wrong order...

In Codeblocks, the very first library at the top is the last to be link.
« Last Edit: January 26, 2015, 11:18:38 pm by math1992 »