基于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

posted @   ChrisZZ  阅读(4536)  评论(1编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
点击右上角即可分享
微信分享提示