codeblocks 配置OpenGL

1、选择编译器环境windows

这里选择codeblocks,带MinGW的版本。工具

2、下载glut工具包code

网址:http://pan.baidu.com/s/1eQriTQMblog

3、配置glut编译器

解压缩下载的glut包。编译

拷贝glut32.dll 到c:\windows\system配置

拷贝glut32.lib到c:\program files\mingw\libfile

拷贝glut.h 到c:\program files\mingw\include\GL下载

以上是针对32位windows系统的。im

若是是64位系统,则:

拷贝glut.dll 到c:\windows\SysWOW64

拷贝glut.lib到c:\program files\mingw\lib

拷贝glut.h 到c:\program files\mingw\include\GL

4、新建项目

直接在codeblocks中新建项目选择GLUT项目

此处须要指定glut库目录

此处须要在文件中添加windows.h的导入

执行结果:

相关文章
相关标签/搜索