You are not logged in.

#1 2016-02-16 19:42:33

aligator
Member
Registered: 2013-10-07
Posts: 75

[solved]experimenting with OpenGL --> /usr/bin/ld: cannot find -lglfw3

hi

I am trying to get an ogl-programm compiled.
I have installed arch new. My old installation still works. I use the same eclipse-project on both arch-installations.

on my old arch, it compiles and on the new one it fails. (so the code is correct)

glfw ist installed and it exists:

 ls -l /usr/lib/libglfw*
lrwxrwxrwx 1 root root    12 13. Okt 14:16 /usr/lib/libglfw.so -> libglfw.so.3
lrwxrwxrwx 1 root root    14 13. Okt 14:16 /usr/lib/libglfw.so.3 -> libglfw.so.3.1
-rwxr-xr-x 1 root root 89320 13. Okt 14:16 /usr/lib/libglfw.so.3.1

but it doesn't compile: (output of eclipse)

Building target: Transformation
Invoking: GCC C++ Linker
g++ --verbose -L"/home/data/Programming/C++/OpenGL2/oglGaming/Debug" -o "Transformation"  ./src/Gaming.o ./src/TutorialGame.o   -lGLEW -lglfw3 -lGL -lX11 -lpthread -lXrandr -lXi -lSOIL -loglGaming
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Ziel: x86_64-unknown-linux-gnu
Konfiguriert mit: /build/gcc/src/gcc-5-20160209/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread-Modell: posix
gcc-Version 5.3.0 (GCC) 
COMPILER_PATH=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-L/home/data/Programming/C++/OpenGL2/oglGaming/Debug' '-o' 'Transformation' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/collect2 -plugin /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccmH2ChF.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o Transformation /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/crt1.o /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/crtbegin.o -L/home/data/Programming/C++/OpenGL2/oglGaming/Debug -L/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../.. ./src/Gaming.o ./src/TutorialGame.o -lGLEW -lglfw3 -lGL -lX11 -lpthread -lXrandr -lXi -lSOIL -loglGaming -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/crtend.o /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib/crtn.o
/usr/bin/ld: cannot find -lglfw3
makefile:45: die Regel für Ziel „Transformation“ scheiterte
collect2: Fehler: ld gab 1 als Ende-Status zurück
make: *** [Transformation] Fehler 1

20:32:48 Build Finished (took 1s.211ms)

I set this workspace up some time ago, and I cannot remember what I did to get it working.
Any idea?

Last edited by aligator (2016-02-17 16:07:50)

Offline

#2 2016-02-17 11:45:13

OlafLostViking
Member
From: Lost
Registered: 2013-01-30
Posts: 59

Re: [solved]experimenting with OpenGL --> /usr/bin/ld: cannot find -lglfw3

Shouldn't it be

-lglfw

instead of

-lglfw3

?

Offline

#3 2016-02-17 13:04:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: [solved]experimenting with OpenGL --> /usr/bin/ld: cannot find -lglfw3

OlafLostViking wrote:

Shouldn't it be

-lglfw

instead of

-lglfw3

?

Yes:

$ pkg-config --libs glfw3
-lglfw

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2016-02-17 16:07:23

aligator
Member
Registered: 2013-10-07
Posts: 75

Re: [solved]experimenting with OpenGL --> /usr/bin/ld: cannot find -lglfw3

ok, you are right.
But I have no idea why glfw3 works on my old system...

Thank you!

Offline

Board footer

Powered by FluxBB