微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

GLEW库不能链接到CodeBlocksMinGW

它列出的未定义的引用清楚地设置在“glew.h”中。 我已经在连接器中包含库,包含在search目录中,并且已经将glew32.dll复制到系统registry中(以及许多其他地方 – MinGW目录内的几个位置以及debugging目录)。 我在他们的网站上使用了最新版本的GLEW,尽pipecodeBlocks和freeglut在十月/十一月份被下载了。 我试图按照OpenGL / glut的快速教程。

显然,debugging器没有正确地链接库/头,但我不明白为什么 – 我到处search,还有一些关于使minGW静态,我不太明白,但它听起来像它doesn为了工作,不需要做

错误面食:

-------------- Build: Debug in Window Tutorial (compiler: GNU GCC Compiler)--------------- mingw32-g++.exe -LC:glew-1.10.0includeGL -LC:freeglutincludeGL -LC:freeglutlib -LC:glew-1.10.0libReleaseWin32 -o "binDebugWindow Tutorial.exe" objDebugmain.o C:glew-1.10.0libReleaseWin32glew32.lib C:glew-1.10.0libReleaseWin32glew32s.lib C:freeglutlibglut32.lib C:freeglutliblibfreeglut.a C:freeglutliblibfreeglut_static.a objDebugmain.o: In function `display': C:/Users/CNOVDM/Other/codeBlocks/Swiftless/Window/Window Tutorial/main.c:5: undefined reference to `glClearColor@16' C:/Users/CNOVDM/Other/codeBlocks/Swiftless/Window/Window Tutorial/main.c:6: undefined reference to `glClear@4' C:/Users/CNOVDM/Other/codeBlocks/Swiftless/Window/Window Tutorial/main.c:7: undefined reference to `glLoadIdentity@0' C:/Users/CNOVDM/Other/codeBlocks/Swiftless/Window/Window Tutorial/main.c:9: undefined reference to `glFlush@0' collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minutes,4 seconds) 4 errors,0 warnings (0 minutes,4 seconds)

代码

如何使用Linux Mint中的Code :: Blocks工作Qt4

C ++半透明窗口SDL

无法在Windows XP上编译rsa.h

即使search目录已configuration,CodeBlock仍未定义对Windows API函数的引用

试图设置一个C编程环境

#include <glew.h> #include <glut.h> void display (void) { glClearColor(1.0f,0.0f,1.0f); //Clear the background of our window to red glClear(GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on) glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations glFlush(); // Flush the OpenGL buffers to the window } int main (int argc,char **argv) { glutinit(&argc,argv); // Initialize gluT glewInit(); glutinitdisplayMode(gluT_SINGLE); //Set Up a basic display Buffer (only single buffered for Now) glutinitwindowSize(500,500); // Set the width and height of the window glutinitwindowPosition(100,100); // set the position of the window glutCreateWindow("My First OpenGL Window"); // Set the title for the window glutdisplayFunc(display); // Tell gluT to use the method "display" for rendering glutMainLoop(); // Enter gluT's main loop }

C ++ linux:dlopen无法find.so

在编译Code :: Blocks之前运行vcvars32.bat?

使用gcc c ++获取Windows版本

wxWidgets如何使用代码块来交叉编译应用程序的Windows从Linux?

如何在Linux中添加boost库到Code :: Blocks

我想你忘了链接到lib文件

阅读手册1.11.13 。

如果使用x64系统,则应将glew32.dll放在libreleasex64到System32 ,另一个放在libreleaseWin32到SysWOW64

这个链接将帮助你理解它。

据我所知,即使你连接到glew,你仍然需要链接到GL。 尝试添加-lopengl32

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐