Author Topic: SFML and Dev-C++  (Read 8774 times)

0 Members and 1 Guest are viewing this topic.

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
SFML and Dev-C++
« on: May 28, 2013, 09:27:29 pm »
Trying to use the Linker, and i'm sure I could get the rest done.
But I got four errors with this code.
Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>
using namespace std;
using namespace sf;

int main() {
    Window window(VideoMode(800, 600), "My Window");
    cin.ignore();
    cin.get();
    return 0;
}

And the errors are(Linker errors of course.)
  [Linker error] undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
  [Linker error] undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
  [Linker error] undefined reference to `_imp___ZN2sf6WindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
  [Linker error] undefined reference to `sf::Window::~Window()'
  [Linker error] undefined reference to `sf::Window::~Window()'
  ld returned 1 exit status

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: SFML and Dev-C++
« Reply #1 on: May 28, 2013, 10:53:36 pm »
You don't need to include SFML/Window.hpp, as Graphics.hpp already does that for you.

For your linker errors, you'll need to add lsfml-system, lsfml-window, and lsfml-graphics to your linker settings.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...