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

Author Topic: g++ Build problem  (Read 4018 times)

0 Members and 1 Guest are viewing this topic.

tintinz

  • Newbie
  • *
  • Posts: 2
    • View Profile
g++ Build problem
« on: June 16, 2010, 02:36:24 am »
hi, I need help to know what I have done wrong. I get the same error when I run Windows as the example on the page.

what should I do?
Code:

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

int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}


error:
Code: [Select]
g++ window-window.cpp -lsfml-window
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Clock::Reset()'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Unicode::UTF8Offsets'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Clock::Clock()'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Clock::GetElapsedTime() const'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Unicode::UTF8TrailingBytes'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/libsfml-window.so: undefined reference to `sf::Sleep(float)'
collect2: ld returned 1 exit status


JollyRoger

  • Newbie
  • *
  • Posts: 17
    • View Profile
g++ Build problem
« Reply #1 on: June 16, 2010, 02:43:34 am »
You also need to link to sfml-system.

tintinz

  • Newbie
  • *
  • Posts: 2
    • View Profile
g++ Build problem
« Reply #2 on: June 16, 2010, 12:48:02 pm »
Quote from: "JollyRoger"
You also need to link to sfml-system.


thank you for the help!:)

JollyRoger

  • Newbie
  • *
  • Posts: 17
    • View Profile
g++ Build problem
« Reply #3 on: June 16, 2010, 04:49:05 pm »
Just so you know, all other modules (sfml-graphics, sfml-audio, etc.) all depend on sfml-system, so you should always link to it when using SFML.