Ubuntu Netbeans C11 und GLFW - linker errors

Hallo, ich sitze schon mehrere Stunden da dran, komme aber nicht weiter.

Also folgende includes:

 #include <GLFW/glfw3.h>

#include <glm/glm.hpp>```

Netbeans ist auf -std=c++11 gestellt, als Bib.-Pfad ist auf /usr/include/GL , und folgende Fehlermeldung beim Übersetzen:


g++ -std=c++11 -o dist/Debug/GNU-Linux/cppapplication_1 build/Debug/GNU-Linux/GLSLProgram.o build/Debug/GNU-Linux/main.o -L/usr/include/GL -Wl,-rpath,/usr/include/GL -lglut -lGL -lglfw3 -lXrandr -lXi -lXrender -ldrm -lXdamage -lXxf86vm -lXext -lX11 -lpthread
/usr/bin/ld: /usr/local/lib/libglfw3.a(glx_context.c.o): undefined reference to symbol ‘dlopen@@GLIBC_2.1
/lib/i386-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status



Jetzt frag ich mich natürlich, was falsch ist.

Danke für eure Antworten.

Eigentlich bin ich ja auch nicht für “LMGTFY”-Links, aber … gcc - Strange linking error: DSO missing from command line - Stack Overflow

Glaub mir, ich hab alle Kombinationen schon ausprobiert, und auch im Internet danach gesucht. …

Kann es an:
-Wl,-rpath,/usr/include/GL
liegen? Wieso sind da auf einmal Kommata?

Muss ich /usr/include und /usr/lib/ auch als Bib.-Pfad angeben?

Linker:

C++:

Was mach ich falsch? Wenn du nicht antworten willst, kein Ding.

Füg’ bei den Linker libraries mal noch
-ldl
hinzu.

g++ -std=c++11    -o dist/Debug/GNU-Linux/cppapplication_1 build/Debug/GNU-Linux/GLSLProgram.o build/Debug/GNU-Linux/main.o -L/usr/include/GL -Wl,-rpath,/usr/include/GL -lglut -lGL -lglfw3 -lXrandr -lXi -lXrender -ldrm -lXdamage -lXxf86vm -lXext -lX11 -lpthread -ldl
build/Debug/GNU-Linux/GLSLProgram.o: In function `cg::GLSLProgram::~GLSLProgram()':
/home/ icke /NetBeansProjects/CppApplication_1/GLSLProgram.cpp:18: undefined reference to `__glewDeleteShader'
[ 100 weitere undefined reference s mit glew und /usr/local/lib/libglfw3.a(x11_init.c.o): ]

Edit: Das hatte ich gemacht:
How to build & install GLFW 3 and use it in a Linux project - Stack Overflow

Update: -lglut -lGL -lglfw3 -lXrandr -lXi -lXrender -ldrm -lXdamage -lXxf86vm -lXext -lX11 -lpthread -ldl -lglut -lGLU -lGL -lGLEW -lglfw3 -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lGL -lpthread

damit funktioniert es. -lGLEW und -lXcursor fehlte. Falls du noch Verbesserungen hast, nehme ich gerne entgegen. Sonst schon mal Vielen Dank!