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

Author Topic: SFML on linux-mint  (Read 2234 times)

0 Members and 1 Guest are viewing this topic.

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
SFML on linux-mint
« on: December 10, 2015, 05:44:56 pm »
Hi,
i recently installed linux mint and tryed to get sfml work on it.
But before I tryed to make sfml work, I installed the newest Version of the GCC-toolchain (GCC 5.3.0).
Cause I read that GNU somewhen changed some APIs in the GCC-API, I compiled SFML by myself (everything worked fine till now).
But now, if I compile a test-sfml project:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
With
g++ main.cpp -DSFML_STATIC -Wl,-Map,mapfile.txt -L/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/ -lGL -lX11 -lX11-xcb -ljpeg -lxcb -lxcb-randr -lxcb-image -ludev -lpthread -lFLAC -logg -lfreetype -lopenal -lvorbis -lvorbisenc -lvorbisfile -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
And run the executable I'm getting the this error:
./a.out: relocation error: ./a.out: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
 
In the mapfile.txt everything looks fine (the right libaries are getting linked) and if I run
strings libstdc++.so | grep _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
I get this output:
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
 

However I suppose, I'm getting this error cause I mixed up some libraries, but if that's in case, how I can figure it out correctly?
Or anyone have other ideas?

Thanks

Julian

Reborn

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: SFML on linux-mint
« Reply #1 on: December 10, 2015, 06:08:46 pm »
After 6 hours of trying, I decided to post here.
Now I fixed the problem after 30 mins.
Obviously make install doesn't install the libstdc++.so.6.0.21. So I copy that file to /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21, and now it works.