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

Author Topic: [Solved] Compiling code doesn't compile anymore due to g++ update  (Read 6824 times)

0 Members and 1 Guest are viewing this topic.

Law

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Hello,

I'm using Ubuntu 15.04 and was compiling my project fine until today. Yesterday I agreed to run the occasional Ubuntu update and today I rebooted my computer. G++ got updated to 5.1.1 and my code suddenly encounters the following linking problems:

ConnectionInterface.o: In function `ConnectionInterface::ConnectionInterface()':
/home/lol/Documents/Coding/Union/ConnectionInterface.cpp:64: undefined reference to `sf::IpAddress::toString[abi:cxx11]() const'
/home/lol/Documents/Coding/Union/ConnectionInterface.cpp:74: undefined reference to `sf::IpAddress::toString[abi:cxx11]() const'
ConnectionInterface.o: In function `ConnectionInterface::EstablishConnection()':
/home/lol/Documents/Coding/Union/ConnectionInterface.cpp:159: undefined reference to `sf::IpAddress::IpAddress(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
Makefile:211: recipe for target 'Menu' failed
make: *** [Menu] Error 1

Usually when I get this issue, I just delete all .o files and start over, or check that I didn't forget any flag, but this time the problem persists. Any advice? Thanks.
« Last Edit: November 15, 2015, 07:56:45 pm by Law »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Compiling code doesn't compile anymore due to g++ update
« Reply #1 on: November 15, 2015, 12:41:35 pm »
You need to rebuild SFML with the new compiler. GCC has an ABI incompatibility between 4.x and 5.x.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Law

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Compiling code doesn't compile anymore due to g++ update
« Reply #2 on: November 15, 2015, 02:19:45 pm »
I used the same SFML directory I first used when I installed it with github, and some things were removed, but now I get that:

/usr/local/lib/libsfgui.so: undefined reference to `sf::String::String(std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> > const&)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::String(std::string const&, std::locale const&)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::Shader::loadFromMemory(std::string const&, std::string const&)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::toAnsiString(std::locale const&) const'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::end()'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::begin() const'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::end() const'
/usr/local/lib/libsfgui.so: undefined reference to `sf::Font::loadFromFile(std::string const&)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::Shader::setParameter(std::string const&, sf::Texture const&)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::String::begin()'
/usr/local/lib/libsfgui.so: undefined reference to `sf::Shader::setParameter(std::string const&, float, float)'
/usr/local/lib/libsfgui.so: undefined reference to `sf::Image::loadFromFile(std::string const&)'
collect2: error: ld returned 1 exit status
Makefile:211: recipe for target 'Menu' failed
make: *** [Menu] Error 1

Do you think I should re-download the whole directory from github?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Compiling code doesn't compile anymore due to g++ update
« Reply #3 on: November 15, 2015, 02:25:34 pm »
Sounds like you're not linking against sfml-system or not in the right order.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Law

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Compiling code doesn't compile anymore due to g++ update
« Reply #4 on: November 15, 2015, 07:56:20 pm »
Sounds like you're not linking against sfml-system or not in the right order.
Precisely! Thank you.

 

anything