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

相关推荐
2501_9280946514 小时前
Ps 2025 图像编辑 Photoshop(Mac中文)
图像处理·macos·photoshop·ps
Magnetic_h17 小时前
【iOS】锁的原理
笔记·学习·macos·ios·objective-c·cocoa·xcode
Cosmoshhhyyy1 天前
mac环境下安装git并配置密钥等
git·macos
肥肥呀呀呀1 天前
mac 安卓模拟器 blueStacks
macos
csdn_aspnet1 天前
如何在 MacOS 上安装 SQL Server
macos·sqlserver
共享家95272 天前
linux-数据链路层
linux·网络·macos
CZIDC3 天前
MacOS字体看起来比在 Windows 上更好?
macos
Cosmoshhhyyy3 天前
linux远程部署dify和mac本地部署dify
linux·运维·macos
行星0083 天前
mac 通过homebrew 安装和使用nvm
macos·npm·node.js