【发布时间】:2014-03-31 01:18:02
【问题描述】:
我正在尝试在 CodeBlocks 13.12 中编译和运行 C++ 和 OpenGL(带有 GLEW)程序。
代码构建成功,但是当我想运行它时,它给了我错误(未找到入口点)说:
程序入口点 glewInit@0 不能位于 动态链接库glew32.dll .
glew32.dll 位于 System32 文件夹中(我使用的是 Win7 x64)。
编辑:
我得到的当前错误是:
||=== Build: Debug in tutorial2cpp (compiler: GNU GCC Compiler) ===|
obj\Debug\glew.o||In function `glewInit_GL_VERSION_1_2':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3233|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3234|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3235|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3236|undefined reference to `wglGetProcAddress@4'|
obj\Debug\glew.o||In function `glewInit_GL_VERSION_1_3':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3253|undefined reference to `wglGetProcAddress@4'|
obj\Debug\glew.o:N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|3254|more undefined references to `wglGetProcAddress@4' follow|
obj\Debug\glew.o||In function `glewGetExtension@4':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|9475|undefined reference to `glGetString@4'|
obj\Debug\glew.o||In function `glewContextInit':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|9495|undefined reference to `glGetString@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|9535|undefined reference to `glGetString@4'|
obj\Debug\glew.o||In function `glewInit_WGL_3DL_stereo_control':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11540|undefined reference to `wglGetProcAddress@4'|
obj\Debug\glew.o||In function `glewInit_WGL_AMD_gpu_association':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11553|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11554|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11555|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11556|undefined reference to `wglGetProcAddress@4'|
obj\Debug\glew.o:N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|11557|more undefined references to `wglGetProcAddress@4' follow|
obj\Debug\glew.o||In function `wglewGetExtension@4':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|12111|undefined reference to `wglGetCurrentDC@0'|
obj\Debug\glew.o||In function `wglewContextInit@0':|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|12124|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|12125|undefined reference to `wglGetProcAddress@4'|
N:\projekticpp\OpenGL\samhocevartutorial\tutorial2cpp\glew.c|12133|undefined reference to `wglGetCurrentDC@0'|
||=== Build failed: 19 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
选择的编译器是 GNU GCC Compiler,我没有更改任何编译器设置。
我想检查 this tutorial ,这显然只是在 part #1 中添加了一些东西。所以我已将第 1 部分代码复制到项目中,但我得到了所有这些错误。显然,我缺少一些基础知识,因为大多数试图让它运行的人似乎没有任何重大问题。因此,我几乎陷入困境,但想学习如何解决此类问题,以便将来避免它们。
【问题讨论】:
标签: c++ opengl codeblocks glew