MacOS X 中 OpenGL 环境搭建 Makefile的方式

1,预备环境

安装 brew:

复制代码
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装glfw:

复制代码
brew install glfw

安装glew:

复制代码
brew install glew

2.编译

下载源代码:

复制代码
git clone https://github.com/AmazingZhen/AsRigidAsPossible_2d.git

下载eigen:

https://eigen.tuxfamily.org/index.php?title=Main_Page

编写Makefile

复制代码
INC      := -I ../3rdParty/eigen-3.4.0  -I /usr/local/Cellar/glfw/3.3.9/include  -I /usr/local/Cellar//glew/2.2.0_1/include  -I ARAP

LD_FLAGS= -L /usr/local/Cellar/glew/2.2.0_1/lib -lGLEW  -L/usr/local/Cellar/glfw/3.3.9/lib  -lglfw -framework OpenGL

#-framework GLUT -framework OpenGL -framework Cocoa -L  /usr/local/Cellar/glew/2.2.0_1/lib -lGLEW   -L/usr/local/Cellar/glfw/3.3.9/lib -lglfw


app: ARAP/arap.cpp   ARAP/main.cpp   ARAP/render.cpp
    clang++ -std=c++17 $^ -o $@ $(INC) $(LD_FLAGS)

3,效果

另外:

类似 ldd:

otool -L libglfw3.dylib

类似 nm:

dump_syms libglfw3.dylib

相关推荐
寒水馨8 小时前
macOS下载、安装uv-0.12.0(附安装包uv-aarch64-apple-darwin.tar.gz)
python·macos·rust·项目管理·包管理器·astral·pip替代
寒水馨9 小时前
macOS下载、安装protobuf-v35.1(附安装包protoc-35.1-osx-universal_binary.zip)
macos·google·grpc·序列化·protobuf·protoc·数据交换
寒水馨9 小时前
macOS下载、安装ripgrep-15.2.0(附安装包ripgrep-15.2.0-aarch64-apple-darwin.tar.gz)
macos·正则表达式·rust·ripgrep·rg·命令行搜索·代码搜索
起司喵喵1 天前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛1 天前
macOS Google Chrome 常用快捷键
前端·chrome·macos
啊真真真1 天前
macOS下libnfc ..写卡失败问题及解决方案
macos·策略模式
叶 落1 天前
Mac 通过 Miniconda 安装 Python
python·macos·conda·miniconda
it-电商达人2 天前
告别手动对齐!Mac播放器Popvee Player支持本地AI自动生成字幕
人工智能·macos
2501_916008892 天前
iOS IPA文件反编译与打包操作方法,拆包分析防护和加固打包
android·macos·ios·小程序·uni-app·cocoa·iphone
凯丨2 天前
2GB 内存跑 Gemma 4 26B 模型:TurboFieldfare Mac 本地部署实测(2026 最新)
macos