【发布时间】:2021-02-09 22:20:54
【问题描述】:
升级到 Catalina 破坏了我的构建,三天的搜索并没有解决问题。代码在 Catalina 之前运行良好。
我得到的具体错误是
/usr/local/include/GL/glew.h:1217:14: fatal error: 'OpenGL/glu.h' file not found
# include <OpenGL/glu.h>
^~~~~~~~~~~~~~ /usr/local/include/GL/glew.h:1217:14:
note: did not find header 'glu.h' in
framework 'OpenGL' (loaded from '/System/Library/Frameworks')
我的 glew 是从 brew 安装的,brew info 说:
$ brew info glew
glew: stable 2.2.0 (bottled), HEAD
OpenGL Extension Wrangler Library
https://glew.sourceforge.io/
Conflicts with:
root (because root ships its own copy of glew)
/usr/local/Cellar/glew/2.2.0 (38 files, 3.4MB) *
Poured from bottle on 2020-10-27 at 10:52:58
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/glew.rb
License: BSD-3-Clause
==> Dependencies
Build: cmake ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 6,917 (30 days), 12,565 (90 days), 50,126 (365 days)
install-on-request: 3,383 (30 days), 6,400 (90 days), 26,243 (365 days)
build-error: 0 (30 days)
据我所知,关于“root 提供自己的 glew 副本”的部分并非如此,因为对整个系统的 find 搜索找不到另一个 glew.h。
我的构建标志是(通过 CMake 设置)
SET(APP_COMPILE_FLAGS "-g -Wall -Wno-nullability-completeness")
SET(APP_LINK_FLAGS "-framework OpenGL -lglfw -lGLEW")
其他可能相关的信息:
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
我正在运行 XCode 12.0.1、XCode 12 的命令工具和 MacOS 10.15.7。有什么见解吗?
【问题讨论】:
-
你能在你的系统上找到文件
glu.h吗? -
是的,sudo find /Library/Developer/CommandLineTools -name glu.h -print 给出 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework /Versions/A/Headers/glu.h。但是仅仅把它作为一个包含目录并没有帮助,因为 Glew 期待“OpenGL/glu.h”
-
Headers/glu.h不是OpenGL/glu.h。还能在OpenGL目录下找到标题glu.h吗? -
对。但对 Glew 的头球做手术似乎不是答案。
-
你为什么只看
/Library/Developer/CommandLineTools?你安装glu.h了吗?glu.h好像没有glew。
标签: c++ opengl macos-catalina glew