簡體   English   中英

為什么 Glew 在 MacOS Catalina 中找不到 OpenGL 標頭?

[英]Why is Glew not finding OpenGL headers in MacOS Catalina?

升級到 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 ships its own copy of glew”的部分並非如此,因為對整個系統的查找搜索沒有找到另一個 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。 有什么見解嗎?

這顯然不是理想的正確答案,但創建鏈接

/usr/local/include/OpenGL -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers

是解決我的問題的黑客。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM