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

相关推荐
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
harmful_sheep6 天前
mac生效的终端查看
macos
iOS门童6 天前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~6 天前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员6 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl843946 天前
mac 安装python
开发语言·python·macos
Bruce_Liuxiaowei6 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw
阿捏利6 天前
详解Mach-O(十五)Mach-O __DATA_CONST
macos·ios·c/c++·mach-o
ShikiSuen6 天前
macOS 的 CpLk 中英切换卡顿的元凶在 InputMethodKit 本身
macos
xiayutian_c7 天前
如虎添翼-MacOS
macos