基于cmake编译glew

cmake已经成为了C/C++开源项目的主流构建工具。glew也提供了cmake的脚本,但用cmake编译glew容易采坑:glew的github上的代码,无论是master分支还是glew-2.1.0这个tag,都无法正确用cmake编译(Linux、OSX亲测,均失败);必须从sourceforge上下载glew,sourceforge下载的glew-2.1.0.tgz才能被cmake正确编译。

tar -zxvf glew-2.1.0.tgz
cd glew-2.1.0
cd build
mkdir linux
cd linux
cmake ../cmake -DCMAKE_INSTALL_PREFIX=./install
make

你个混球,@Nigel Stewart,浪费我时间。

p.s. 如果cmake报错提示:
Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
OPENGL_INCLUDE_DIR)

则需要安装:
sudo apt-fast install libgl1-mesa-dev

如果cmake报错提示:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_glu_LIBRARY (ADVANCED)

则需要安装:
sudo apt-get install libglu1-mesa-dev

原文链接: https://www.cnblogs.com/zjutzz/p/10982675.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    基于cmake编译glew

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/296295

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月15日 下午5:45
下一篇 2023年2月15日 下午5:46

相关推荐