SDL2 安装于 xCode
SDL2 installing on xCode
我已从 https://www.libsdl.org 下载 SDL2.frameworks 并将其安装到 /Libraries/Frameworks/。然后我在 xcode 指向框架的路径,在 'Build Settings' 中指向 headers,在 'General' 'Frameworks and Libraries' 中指向框架文件 libSDL2-2.0.0.dylib .我键入 #include 并尝试构建项目。它显示 150 多个警告,但如果我尝试 运行 该程序,它会说库未加载。为什么?问题是什么?我正在使用大苏尔 OS
我想通了。
- 我已经从 https://brew.sh
安装了自制软件
- 我在终端输入
brew install sdl2
- 然后我显示了框架的路径(在 xCode select 项目文件 >> 构建设置 >> header 搜索路径)并使用
cmd+shift+g
类型 /usr/local/include
- 在 General Frameworks & Libraries 中放入 libSDL2-2.0.0.dylib(在此处
/usr/local/Cellar/sdl2/2.0.14_1/lib)
- 最重要的是,我检查了
Disable Library Validations
签名和功能
完成这些步骤后代码开始为我工作
您需要codesign
Framework。(Lazy Foo 的命令可能不正确)。
- 找出自己的签名:
security find-identity
- 签署框架:
codesign -f -s "XXXX Your signature" SDL2.framework
不要忘记在 ./Versions/A/Frameworks
.
中签署另一个 hidapi.framework
- 您可以验证签名:
codesign -display --verbose=4 SDL2.framework
我已从 https://www.libsdl.org 下载 SDL2.frameworks 并将其安装到 /Libraries/Frameworks/。然后我在 xcode 指向框架的路径,在 'Build Settings' 中指向 headers,在 'General' 'Frameworks and Libraries' 中指向框架文件 libSDL2-2.0.0.dylib .我键入 #include
我想通了。
- 我已经从 https://brew.sh 安装了自制软件
- 我在终端输入
brew install sdl2
- 然后我显示了框架的路径(在 xCode select 项目文件 >> 构建设置 >> header 搜索路径)并使用
cmd+shift+g
类型 /usr/local/include - 在 General Frameworks & Libraries 中放入 libSDL2-2.0.0.dylib(在此处 /usr/local/Cellar/sdl2/2.0.14_1/lib)
- 最重要的是,我检查了
Disable Library Validations
签名和功能
完成这些步骤后代码开始为我工作
您需要codesign
Framework。(Lazy Foo 的命令可能不正确)。
- 找出自己的签名:
security find-identity
- 签署框架:
codesign -f -s "XXXX Your signature" SDL2.framework
不要忘记在 ./Versions/A/Frameworks
.
- 您可以验证签名:
codesign -display --verbose=4 SDL2.framework