libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
8.28k stars 1.53k forks source link

[macos] SDL3.xcframework installed in /Library/Frameworks, clang not finding framework #9479

Open nbriggs opened 3 weeks ago

nbriggs commented 3 weeks ago

On macOS Monterey, 12.7.4 - have both SDL2 and SDL3 installed in /Library/Frameworks:

 % ls /Library/Frameworks | grep SDL
SDL2-2.28.framework
SDL2-2.30.0.framework
SDL2-2.30.1.framework
SDL2.framework
SDL3.xcframework

and while compiling with -framework SDL2 works, compiling with -framework SDL3 does not, and produces the error

clang -m64 -target x86_64-apple-darwin -std=gnu99 [...] -F /Library/Frameworks -framework SDL3 -o ../darwin.x86_64/ldesdl
ld: framework not found SDL3
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks as though clang

% clang --version
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

isn't prepared to deal with the .xcframework properly?

sridenour commented 3 weeks ago

An .xcframework isn't the same as a .framework

Does it work if you put SDL3.framework in /Library/Frameworks?