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

Author Topic: FIXED undefined reference to sf::RenderWindow::RenderWindow  (Read 9923 times)

0 Members and 1 Guest are viewing this topic.

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« on: December 16, 2011, 05:23:21 am »
Hello all
I just pulled from github, and when I compile I get the following error
Code: [Select]

undefined reference to sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)



My code is as so

Code: [Select]
sf::RenderWindow window(sf::VideoMode(640, 480), "Name");


tx

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #1 on: December 16, 2011, 07:56:16 am »
Do you link to sfml-graphics?
Laurent Gomila - SFML developer

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #2 on: December 17, 2011, 05:48:20 am »
g++ obj/badguy.o obj/player.o obj/main.o -lsfml-system -lsfml-network -lsfml-window -lsfml-graphics -o bin/hungrybubble

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #3 on: December 21, 2011, 05:05:11 am »
bump

TheJames

  • Newbie
  • *
  • Posts: 6
    • View Profile
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #4 on: December 21, 2011, 06:35:45 am »
Im pretty sure when you link the lib files you have to do them in reverse order of dependency.

So it would be: -lsfml-network -lsfml-graphics -lsfml-window -lsfml-system

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #5 on: December 21, 2011, 08:01:51 pm »
No dice...

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #6 on: December 21, 2011, 10:57:44 pm »
I just fetched the git source today, and still no luck.. I am on Arch Linux, if that helps...

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #7 on: December 22, 2011, 12:11:20 am »
Look, no one is answering since they don't know. You are not giving us enough information to work on. Your doing something wrong as this is a linkage failure.

What version of SFML are you using? (I guess SFML 2.0?) Do you follow the tutorials? And do you get more linkage errors if you try to use code that is in another module will you also get reference errors there? Have you tried a complete clean rebuild(remove anything that has to do with SFML from the computer and do everything again from scratch)?

And don't remember, but do you still have to define SFML_DYNAMIC for SFML2 on Linux?

Plus you would have gotten your answer much faster if you would just have searched the forum as thousands topics is just about this.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #8 on: December 22, 2011, 08:30:49 am »
And also make sure that you're not linking to an old SFML 1.6.
Laurent Gomila - SFML developer

strongdrink

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FIXED undefined reference to sf::RenderWindow::RenderWindow
« Reply #9 on: December 28, 2011, 07:19:52 pm »
This has been fixed after another full rebuild of SFML.. thanks