OpenGL - 构建错误,对__glutInitWithExit'的未定义引用

时间:2017-05-28 17:41:39

标签: c++ opengl codeblocks

我有一个错误,一直困扰我一段时间: 我用Codeblocks安装了OpenGl。 我添加了所有必需的文件,它在开始时工作,但它突然给了我这个错误:

-------------- Build: Debug in testtt (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib" -LC:\OpenCV2.0\lib -o bin\Debug\testtt.exe obj\Debug\main.o   -lglut32 -lopengl32 -lglu32 -lwinmm -lgdi32 C:\OpenCV2.0\lib\libcv200.dll.a C:\OpenCV2.0\lib\libcvaux200.dll.a C:\OpenCV2.0\lib\libcxcore200.dll.a C:\OpenCV2.0\lib\libcxts200.dll.a C:\OpenCV2.0\lib\libhighgui200.dll.a C:\OpenCV2.0\lib\libml200.dll.a "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libglut32.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libglu32.a"
obj\Debug\main.o: In function `glutInit_ATEXIT_HACK':
C:/Program Files (x86)/CodeBlocks/MinGW/include/GL/glut.h:486: undefined reference to `__glutInitWithExit'
obj\Debug\main.o: In function `glutCreateWindow_ATEXIT_HACK':
C:/Program Files (x86)/CodeBlocks/MinGW/include/GL/glut.h:503: undefined reference to `__glutCreateWindowWithExit'
obj\Debug\main.o: In function `glutCreateMenu_ATEXIT_HACK':
C:/Program Files (x86)/CodeBlocks/MinGW/include/GL/glut.h:549: undefined reference to `__glutCreateMenuWithExit'
obj\Debug\main.o: In function `resize':
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:33: undefined reference to `_imp__glViewport'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:34: undefined reference to `_imp__glMatrixMode'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:35: undefined reference to `_imp__glLoadIdentity'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:36: undefined reference to `_imp__glFrustum'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:38: undefined reference to `_imp__glMatrixMode'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:39: undefined reference to `_imp__glLoadIdentity'
obj\Debug\main.o: In function `display':
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:44: undefined reference to `glutGet'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:47: undefined reference to `_imp__glClear'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:48: undefined reference to `_imp__glColor3d'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:50: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:51: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:52: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:53: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:54: undefined reference to `glutSolidSphere'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:55: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:57: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:58: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:59: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:60: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:61: undefined reference to `glutSolidCone'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:62: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:64: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:65: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:66: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:67: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:68: undefined reference to `glutSolidTorus'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:69: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:71: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:72: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:73: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:74: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:75: undefined reference to `glutWireSphere'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:76: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:78: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:79: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:80: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:81: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:82: undefined reference to `glutWireCone'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:83: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:85: undefined reference to `_imp__glPushMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:86: undefined reference to `_imp__glTranslated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:87: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:88: undefined reference to `_imp__glRotated'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:89: undefined reference to `glutWireTorus'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:90: undefined reference to `_imp__glPopMatrix'
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:92: undefined reference to `glutSwapBuffers'
obj\Debug\main.o: In function `key':
C:/Users/salah/Documents/project OpenGL/testtt/main.cpp:119: undefined reference to `glutPostRedisplay'
Process terminated with status 1 (0 minute(s), 0 second(s))
50 error(s), 0 warning(s) (0 minute(s), 0 second(s))

感谢您的帮助。

0 个答案:

没有答案