SFML community forums
Help => General => Topic started by: JohnGreek on September 11, 2009, 11:12:49 am
-
Heya, this is my first post here and i'd like to say hi to everybody :D
now to the point:
I am using Dev C++ as IDE and when i try to compile the simplest window app(just using window.hpp) i keep getting those errors:
--------------------
In function `main':
[Linker error] undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
[Linker error] undefined reference to `sf::Window::Window(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&)'
[Linker error] undefined reference to `sf::Window::Display()'
[Linker error] undefined reference to `sf::Window::~Window()'
[Linker error] undefined reference to `sf::Window::~Window()'
ld returned 1 exit status
--------------------
I just don't understand why i get those link errors.
I did a small search and i found that those errors occur when i am using a function that is not inside the headers i include but i think everything is fine...
I have tried everything(look for other tutorials, rewrite the code a hundred times) but still nothing.
I am kinda newbie to libraries so i could use some help :P
-
You have to link to libsfml-window, the same way you linked to libsfml-system.
-
and how exactly i link to that?
-
This is explained in the "getting started" tutorial. There's none for Dev-C++, but it should be similar to Code::Blocks.
By the way, you should throw away Dev-C++ (which died a long time ago) and use a more recent IDE like Code::Blocks.
-
thx for your fast reply :)
well, yeah you are right, devcpp is long ago abandoned...
so i downloaded code blocks and i configured it but i get the same errors like devcpp.
i made all the steps many times, added the includes and the library, but still no luck.
SS of the compiler (http://i708.photobucket.com/albums/ww83/BinPDA/img1.jpg)
-
Like explained in the tutorial, you need to link to sfml-system for this piece of code.
-
but that's the point, i did everything step-by-step on the tutorial for Code Blocks and still it's not working, i get the the same errors.
those errors mean the sfml-system library is not linked...
i just don't understand what i'm doing wrong :/
EDIT: i got it working, thx for your help