该开发环境是配合书籍《OpenGL ES3.0编程指南》来配置的。
软件:PowerVRSDKSetup-2018_R2.run-x64
下载地址:https://www.imgtec.com/developers/powervr-sdk-tools/installers/
操作系统:Ubuntu 16.04
adayo@ubuntu:/work/opengles3-book-master/build$ sudo ./PowerVRSDKSetup-2018_R2.run-x64
adayo@ubuntu:/work/opengles3-book-master/build$ sudo apt-get install build-essential cmake cmake-curses-gui
adayo@ubuntu:/work$ ls
opengles3-book-master opengles3-book-master.zip
adayo@ubuntu:/work$ cd opengles3-book-master/
adayo@ubuntu:/work/opengles3-book-master$ ls
Android_Java Chapter_14 Chapter_7 CMakeLists.txt LICENSE
Chapter_10 Chapter_2 Chapter_8 Common README.md
Chapter_11 Chapter_6 Chapter_9 External
adayo@ubuntu:/work/opengles3-book-master$ mkdir build
adayo@ubuntu:/work/opengles3-book-master$ cd build
adayo@ubuntu:/work/opengles3-book-master/build$ cmake ../
需要配置库文件路径:
adayo@ubuntu:/work/opengles3-book-master/build$ccmake ../
enter 进入编辑。
找到
/opt/Imagination/PowerVR_Graphics/PowerVR_Tools/PVRVFrame/Library/Linux_x86_64/libEGL.so
/opt/Imagination/PowerVR_Graphics/PowerVR_Tools/PVRVFrame/Library/Linux_x86_64/libGLESv2.so
这个两个路径非常重要,如果选择错误,编译出来的可执行程序运行时会发生段错误。
完成配置后按C保存,再按Q退出ccmake。
再执行cmake,生成makefile,然后执行make:
adayo@ubuntu:/work/opengles3-book-master/build$ cmake ../
adayo@ubuntu:/work/opengles3-book-master/build$ make
准备运行Hello_Triangle
adayo@ubuntu:/work/opengles3-book-master/build/Chapter_2$ cd Hello_Triangle/
adayo@ubuntu:/work/opengles3-book-master/build/Chapter_2/Hello_Triangle$ ls
CMakeFiles cmake_install.cmake Hello_Triangle Makefile
adayo@ubuntu:/work/opengles3-book-master/build/Chapter_2/Hello_Triangle$ ./Hello_Triangle