Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: hellninjas on May 28, 2013, 09:27:29 pm

Title: SFML and Dev-C++
Post by: hellninjas 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
Title: Re: SFML and Dev-C++
Post by: Scipi 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.