2012-02-17 4 views
3

J'essaie d'utiliser GLFW sur un projet, mais lorsque je le compile, j'obtiens beaucoup d'erreurs de référence non définies, alors que beaucoup d'entre elles se trouvent dans le fichier de bibliothèque (libglfw.a). J'ai essayé les deux, compiler la bibliothèque et la télécharger, mais sans succès. J'utilise MinGW et MSYS fonctionnant sur Windows 7 32 bits sur netbeans. La version GLFW est 2.7.3;GLFW Undefined References

Ce sont les erreurs:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/prism.exe 
make[2]: Entering directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' 
mkdir -p build/Debug/MinGW-Windows 
rm -f build/Debug/MinGW-Windows/main.o.d 
g++.exe -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp 
mkdir -p dist/Debug/MinGW-Windows 
g++.exe  -o dist/Debug/MinGW-Windows/prism build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/ByteBuffer.o -Lexternal -lglfw 
build/Debug/MinGW-Windows/main.o: In function `main': 
C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:35: undefined reference to `[email protected]' 
C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:36: undefined reference to `[email protected]' 
build/Debug/MinGW-Windows/main.o: In function `Z6renderv': 
C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:56: undefined reference to `[email protected]' 
C:\Users\Raphael\Documents\NetBeansProjects\Prism/main.cpp:57: undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(window.o):window.c:(.text+0x8ae): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0xe54): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0xe6c): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0xef6): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0xf4f): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0xf7f): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x174c): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1935): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x19fe): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1a0e): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1ea6): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1ebc): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1ed8): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1ee7): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_window.o):win32_window.c:(.text+0x1f1a): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(glext.o):glext.c:(.text+0x1a): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(glext.o):glext.c:(.text+0x1bf): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(glext.o):glext.c:(.text+0x1ef): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(glext.o):glext.c:(.text+0x28b): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(glext.o):glext.c:(.text+0x2cf): undefined reference to `[email protected]' 
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libglfw.a(win32_glext.o):win32_glext.c:(.text+0x7d): undefined reference to `[email protected][2]: Leaving directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' 
make[1]: Leaving directory `/c/Users/Raphael/Documents/NetBeansProjects/Prism' 
' 
collect2: ld returned 1 exit status 
make[2]: *** [dist/Debug/MinGW-Windows/prism.exe] Error 1 
make[1]: *** [.build-conf] Error 2 
make: *** [.build-impl] Error 2 

CONSTRUIR FALHOU (valor da saída 2, tempo total: 1s) 
+0

@ildjarn Je pense que cela n'a pas d'importance –

+3

Vous n'avez pas besoin de lier les bibliothèques OpenGL aussi? Je ne vois pas «libGL» ou «libGLU». Je sais que 'glClear' est soit' libGL' ou 'libGLU'. Publié comme une réponse parce que je suis sûr à 95% que c'est le problème ... – JimR

Répondre

10

ne vous devez relier les libs OpenGL ainsi? Je ne vois pas libGL ou libGLU. Je sais que glClear est soit libGL ou libGLU.

+7

Eh bien, puisque cela a été accepté comme réponse, lequel était-il? – Ludwik

6

Dans l'éditeur de liens, à Windows MinGW: -lglew32 -lglfw3 -lopengl32 -lglu32 -lgdi32

Mettez les libs et inclut des fichiers dans MinGW et les dll et exes dans les dossiers systèmes Windows.

5

Dans mon cas, le problème était différent. Je liais opengl32, mais je recevais toujours l'erreur. Le problème s'est avéré être l'ordre de bibliothèque: glfw doit être lié dans avant opengl32.

Dans mon cas, c'était dans la zone de liste "Bibliothèques de liens" de l'IDE Code :: Blocks, mais cela sera similaire dans NetBeans ou sur la ligne de commande.