Windows7下搭建OpenGL ES.0开发环境(VS2017)
参考别人的文章:https:///brahmsjiang/article/details/78572141,但是这篇文章对编译过程中出现的各种问题没有说明,因此特此记录下。
一、安装VS2017
(1)下载网址:https:///zh-hans/vs/
(2)安装过程参考:https:///vcblog/2017/04/21/getting-started-with-visual-studio-for-c-and-cpp-development/
二、下载《OpenGL ES.0 Programming guide》示例代码:
https://codeload.github/danginsburg/opengles-book/zip/master
三、下载mail opengl es模拟器(我也是下载2位的:Mali_OpenGL_ES_Emulator-v.0.2.g694a9-Windows-2bit):
http://malideveloper.arm/resources/tools/opengl-es-emulator/
四、解压Mali_OpenGL_ES_Emulator-v.0.2.g694a9-Windows-2bit
(1)将include目录下的四个文件夹:EGL, GLES2, GLES, KHR都拷贝到VS2017的安装路径下:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\include
(2)将libEGL.lib,libGLESv2.lib,libMaliEmulator.lib拷贝到:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\lib\x86
()将除去include目录剩余的都拷贝到:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx86\x86
(4)将libEGL.dll,libGLESv2.dll,libMaliEmulator.dll, openglessl目录及log4cplus.dll拷贝到C:\Windows\SysWOW64
五、准备工作作完可以开始编译sample code了
(1)打开VS,新建一个空的工程。将opengles-book-master\Chapter_2\Hello_Triangle\Hello_和opengles-book-master\Common目录拷贝到工程目录下。并将代码源文件添加到工程中
(2)将opengles-book-master\Common\Include目录添加到附加路径,点击项目-》属性-》C/C-》通用(General)-》Additional Include Directiories然后编辑添加。如果没添加路径会报esUtil.h头文件不到的问题。
()点击preprocessor预处理器选项,将;_CRT_SECURE_O_WARIGS字段添加到Preprocessor Definiti里。否则会出现:fopen: This function or variable may be unsafe......的错误。
(4)将C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\lib\x86添加到连接器的lib路径,否则会报不到libEGL.lib类似的错误。
(5)修改连接器Input附加依赖项,加入libGLESv2.lib;libEGL.lib;libMaliEmulator.lib
(6) 编译链接的时候还可能遇到类似Loaded C:\Windows\System2\kernel2.dll , Cannot find or open the PDB file的问题
解决方法:点击工具-》选项-》Debugging-》Symbols将Microsoft Symbol Servers勾选。
(7)编译运行,选择X86,点击绿箭头运行。
运行效果如图:
最后记录下学习opengl的网址:
https://learnopengl/
https://learnopengl-cn.github.io/
http://nehe.gamedev/
https://www.khronos/registry/OpenGL-Refpages/es.0/
#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
推荐阅读
留言与评论(共有 11 条评论) |
本站网友 杭州论坛 | 0秒前 发表 |
This function or variable may be unsafe......的错误 | |
本站网友 潮汕人在深圳 | 15分钟前 发表 |
\Windows\SysWOW64 五 | |
本站网友 6月20日是什么星座 | 21分钟前 发表 |
(7)编译运行,选择X86,点击绿箭头运行 | |
本站网友 精金棒 | 22分钟前 发表 |
This function or variable may be unsafe......的错误 | |
本站网友 南京金地名京 | 3分钟前 发表 |
解压Mali_OpenGL_ES_Emulator-v.0.2.g694a9-Windows-2bit (1)将include目录下的四个文件夹:EGL | |
本站网友 宝宝鼻塞怎么办 | 13分钟前 发表 |
///vcblog/2017/04/21/getting-started-with-visual-studio-for-c-and-cpp-development/ 二 | |
本站网友 奉贤二手房出售 | 12分钟前 发表 |
//learnopengl-cn.github.io/ http | |
本站网友 孕期保健 | 13分钟前 发表 |
安装VS2017 (1)下载网址:https | |
本站网友 珠海大学 | 15分钟前 发表 |
\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\lib\x86 ()将除去include目录剩余的都拷贝到:C | |
本站网友 古月照今尘 | 4分钟前 发表 |
///zh-hans/vs/ (2)安装过程参考:https |