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

Author Topic: Trouble compiling sample files  (Read 1786 times)

0 Members and 1 Guest are viewing this topic.

Amablue

  • Newbie
  • *
  • Posts: 13
    • View Profile
Trouble compiling sample files
« on: August 31, 2010, 06:33:18 am »
I installed SFML from scratch today. I downloaded the 1.6 source, ran make install, and tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I'm trying to compile this one specifically, but I get these errors:
 
g++ -o atest test.cpp -lsfml-graphics -lsfml-window -lsfml-system /tmp/ccaa86fR.o: In function `main':
test.cpp:(.text+0x1d2): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
make: *** [test] Error 1

Trying an even simpler project, the one in the initial tutorial, I don't run into problems compiling. However, when I try to run it, I get this error:

./atest: error while loading shared libraries: libsfml-graphics.so.1.6: cannot open shared object file: No such file or directory

I checked, and the files did install to /usr/local/lib/ which is where they're supposed to go as far as I know. [/url]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Trouble compiling sample files
« Reply #1 on: August 31, 2010, 08:15:27 am »
Quote
undefined reference to `gluPerspective'

You have to link to GLU (-lGLU).

Quote
error while loading shared libraries: libsfml-graphics.so.1.6: cannot open shared object file: No such file or directory

/usr/local/lib is probably not in your LD_LIBRARY_PATH, you have to add it manually.
Laurent Gomila - SFML developer