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

Author Topic: SFML dont work in devcpp  (Read 2546 times)

0 Members and 1 Guest are viewing this topic.

Alfonso1

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML dont work in devcpp
« on: May 02, 2011, 08:01:51 pm »
I had download Windows - MinGW (Code::Blocks) (34.4 MB)

and in the project opcions I had put:
the direction of SFML-1.6\lib in "Library directories"
and the direction of SFML-1.6\include in "Include derectories"

but when I try to compile it geves me an error:

[Linker error] undefined reference to `sf::Clock::Clock()'

the code is these:

Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
SFML dont work in devcpp
« Reply #1 on: May 02, 2011, 08:21:29 pm »
In the title you say you are using Dev-C++, in the post you speak about Code::Blocks. What IDE do you work with? Dev-C++ shouldn't be used anymore.

You must link the libraries, until now you have only specified where the libraries are, but not which libraries to use. This is explained in the tutorials.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Alfonso1

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML dont work in devcpp
« Reply #2 on: May 02, 2011, 08:57:14 pm »
I am working with dev cpp

I download Windows - MinGW (Code::Blocks) (34.4 MB) from here
http://www.sfml-dev.org/download.php

beacuse I think that the IDE devcpp use the compiler MinGW, ¿is these correct?

Quote
You must link the libraries


I dont know how, I said:
Quote
in the project opcions I had put:
the direction of SFML-1.6\lib in "Library directories"
and the direction of SFML-1.6\include in "Include derectories"

but that doesn't work

Quote
until now you have only specified where the libraries are, but not which libraries to use.


How can I do these?

thank for the reply and sorry for my writing (The english is not my lenguage)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
SFML dont work in devcpp
« Reply #3 on: May 02, 2011, 09:25:59 pm »
First, get rid of Dev-C++. It is not developped anymore and SFML doesn't officially support it. There are much better IDEs around, one of which is Code::Blocks. I would use either Code::Blocks or Visual Studio (when programming on Windows).

Quote
I dont know how, I said:
Yes, and I said linking the libraries is explained in the SFML tutorials.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything