其他分享
首页 > 其他分享> > MAC引用SDL2

MAC引用SDL2

作者:互联网

安装SDL2库

  1. brew install sdl2
  2. 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
  1. 使用
#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