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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Grunz

Pages: [1]
1
General / Linker Errors Ubuntu
« on: March 13, 2012, 10:08:04 pm »
Yes, the -L does work, but only if I then also use the battalion of "-l" parameters like this:
Code: [Select]
g++ Window.cpp  -L /usr/local/lib -lsfml-window -lsfml-graphics -lsfml-system -lGLU -lGL -lSM -lICE -lX11 -lXext -lpthread -lrt -lXrandr -o windowSo, without -L, the linker can find openGL and the other stuff all by itself, but if I use it, it no longer can.
B.t.w. ,the man/info page for gcc does only mention the existence of the -L option. It is nowhere explained what it actually does. And I can call g++ -L "nonexisting path" and will get no errors from that. :(

2
General / Linker Errors Ubuntu
« on: March 13, 2012, 03:15:49 am »
OK, digging recursively through make and cmake calling each other recursively it looks like using full path to SFML libraries is required. So
Code: [Select]
g++ -lsfml-window -lsfml-graphics -lsfml-system -lGLU -lGL -lSM -lICE -lX11 -lXext -lpthread -lrt -lXrandr -o window Window.cppcompiles but linker fails. As mentioned already:
Code: [Select]
g++ -c Window.cppdoes create the .o just fine without any extra flags.
Using full path like this:
Code: [Select]
g++ -O3 Window.cpp  -o window /usr/local/lib/libsfml-window.so.2.0 /usr/local/lib/libsfml-system.so.2.0 -lGLU -lGL -lSM -lICE -lX11 -lXext -lpthread -lrt -lXrandrdoes work.
Checking "g++ -v" reveals that /usr/local/lib is not in the library path:
Code: [Select]
..
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/
..

Would adding /usr/local/lib help avoid those unwieldy parameters? Does someone know how to do so?

3
General / Linker Errors Ubuntu
« on: March 11, 2012, 11:22:10 pm »
System: Ubuntu 11.10 64 bit
cpu: AMD Phenom(tm) II X4 965 Processor × 4
I installed the 2.0 snapshot LaurentGomila-SFML-2de690f via cmake / Makefile. Had it make everything and did a "sudo make install"
This all looked good and /usr/local/lib/ now contains:
Code: [Select]
libsfml-audio.so         libsfml-network.so.2.0  libsndfile.la
libsfml-audio.so.2       libsfml-system.so       libsndfile.so
libsfml-audio.so.2.0     libsfml-system.so.2     libsndfile.so.1
libsfml-graphics.so      libsfml-system.so.2.0   libsndfile.so.1.0.25
libsfml-graphics.so.2    libsfml-window.so       pkgconfig
libsfml-graphics.so.2.0  libsfml-window.so.2     python2.6
libsfml-network.so       libsfml-window.so.2.0   python2.7
libsfml-network.so.2     libsndfile.a            site_ruby
also /usr/local/share/SFML/examples/ has:
Code: [Select]
ftp  opengl  pong  shader  sockets  sound  sound-capture  voip  window  X11
However, if I try to compile an example myself like this:
Code: [Select]
gcc Window.cpp
/tmp/ccygC6cP.o: In function `main':
Window.cpp:(.text+0x3e): undefined reference to `std::allocator<char>::allocator()'
Window.cpp:(.text+0x53): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
 ... (more "undefined" errors)
/tmp/ccygC6cP.o:(.eh_frame+0x4b): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
So somehow "make" did know how to compile the examples, but I do not.  :oops:

Pages: [1]
anything