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

相关推荐
名字不要太长 像我这样就好41 分钟前
【iOS】继承链
macos·ios·cocoa
潜龙95272 小时前
第4.3节 iOS App生成追溯关系
macos·ios·cocoa
玄辰星君11 小时前
【MAC】nacos 2.5.1容器docker安装
macos·docker·nacos
atwdy16 小时前
MacOS安装linux虚拟机
linux·运维·ubuntu·macos·utm
echola_mendes17 小时前
Dify:在MacOS系统下Dify的本地部署与使用
macos
Tim风声(网络工程师)17 小时前
如何通过mac的前24bit,模糊确认是那一台什么样的设备
运维·服务器·网络·macos
菜鸟555551 天前
河南萌新联赛2025第一场-河南工业大学
macos·objective-c·cocoa
名字不要太长 像我这样就好2 天前
【iOS】源码阅读(六)——方法交换
开发语言·macos·ios·objective-c·cocoa
Digitally2 天前
轻松将文件从 iPhone 传输到 Mac
macos·ios·iphone
小诸葛的博客2 天前
mac电脑无法阅读runc源码
macos·策略模式