MAC引用SDL2
作者:互联网
安装SDL2库
- brew install sdl2
- pro添加库(库路径用brew info sdl2查看)
LIBS += -L/usr/local/Cellar/sdl2/2.0.10/lib/ -lSDL2-2.0.0
INCLUDEPATH += /usr/local/Cellar/sdl2/2.0.10/include
- 使用
#include<SDL/SDL.h>后直接使用
设置动态库加载路径
在pro中添加:
# set RPATH (place to look for .dylib & framework by default设置加载库的路径)
QMAKE_RPATHDIR += @executable_path/../Frameworks
QMAKE_RPATHDIR += @executable_path/lib
标签:executable,Cellar,lib,sdl2,SDL2,MAC,引用,2.0 来源: https://blog.csdn.net/Give_me_money/article/details/113424258