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

Author Topic: Linking to libsfml-system on linux  (Read 2124 times)

0 Members and 1 Guest are viewing this topic.

wasalski

  • Newbie
  • *
  • Posts: 5
    • View Profile
Linking to libsfml-system on linux
« on: April 26, 2011, 06:33:13 pm »
I installed SFML in my home directory, and am trying to compile the example from http://www.sfml-dev.org/tutorials/1.6/start-linux.php .

this is the command I use:

g++ first.cc -I/home/wasalski/SFML-1.6/include -L/home/wasalski/SFML-1.6/lib -lsfml-system  

as you can see, I including the header files and the library path

I get the following error message:

/usr/bin/ld: cannot find -lsfml-system
collect2: ld returned 1 exit status

but I have verified that libsfml-system.so.1.6 exists, and have tried to make a symlink to libsfml-system.so.1.6 called libsfml-system.so

wasalski@jamieson2:~/SFML-1.6/lib                                               $ ls
libsfml-audio.so.1.6     libsfml-network.so.1.6  libsfml-system.so.1.6
libsfml-graphics.so.1.6  libsfml-system.so       libsfml-window.so.1.6

Now I am out of ideas, can anyone tell me what is going on?

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Linking to libsfml-system on linux
« Reply #1 on: April 27, 2011, 04:54:06 am »
I think you need a "-o" and an application name in there if it's like MinGW.

g++ -I/home/wasalski/SFML-1.6/include first.cc -o first -L/home/wasalski/SFML-1.6/lib -lsfml-system

wasalski

  • Newbie
  • *
  • Posts: 5
    • View Profile
Linking to libsfml-system on linux
« Reply #2 on: April 27, 2011, 04:53:35 pm »
Thanks!

wasalski

  • Newbie
  • *
  • Posts: 5
    • View Profile
Linking to libsfml-system on linux
« Reply #3 on: April 28, 2011, 06:58:29 pm »
Now I'm using:

$ g++ -I/home/wasalski/SFML-1.6/include first.cc -o first -L/home/wasalski/SFML-1.6/lib -lsfml-system

And getting:

/home/wasalski/SFML-1.6/lib/libsfml-system.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)@GLIBCXX_3.4.9'
/home/wasalski/SFML-1.6/lib/libsfml-system.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
collect2: ld returned 1 exit status

Can anyone tell me what is going on?

 

anything