| Summary: | [patch] Fix Metal link errors with test programs in SDLTest.xcodeproj | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Eric Wasylishen <ewasylishen> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Other | ||
| Attachments: | Fix link errors in SDLTest.xcodeproj | ||
Added, thanks! https://hg.libsdl.org/SDL/rev/728f670288e4 |
Created attachment 3176 [details] Fix link errors in SDLTest.xcodeproj Xcode 9.2/macOS 10.13.3 The following patch adds Metal.framework to the "link binary with libraries" section of each test program, with "status" set to "optional", which fixes link errors on all of the test programs. I'm not sure if this is a correct fix - the fact that this was necessary might indicate the static SDL2.a library has a hard dependency on Metal.framework (?) - but it gets the test programs working in Xcode again. It also adds testyuv_cvt.c to the testoverlay2 target, fixing a link error. Here is an example of the error I was getting before adding Metal.framework: ``` Ld /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Products/Debug/testoverlay2 normal x86_64 cd /Users/ericwa/dev/SDL-Mirror/Xcode/SDLTest export MACOSX_DEPLOYMENT_TARGET=10.6 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Products/Debug -F/Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Products/Debug -F/Users/ericwa/dev/SDL-Mirror/Xcode/SDLTest/../SDL/build/Debug -F/Users/ericwa/Library/Frameworks -F/Library/Frameworks -filelist /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Intermediates.noindex/SDLTest.build/Debug/testoverlay2.build/Objects-normal/x86_64/testoverlay2.LinkFileList -mmacosx-version-min=10.6 -Xlinker -object_path_lto -Xlinker /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Intermediates.noindex/SDLTest.build/Debug/testoverlay2.build/Objects-normal/x86_64/testoverlay2_lto.o -Xlinker -no_deduplicate -framework CoreVideo -framework Cocoa -framework CoreAudio -framework ForceFeedback -framework IOKit -framework AudioToolbox -framework CoreFoundation -framework AudioUnit -framework Carbon /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Products/Debug/libSDL2.a -Xlinker -dependency_info -Xlinker /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Intermediates.noindex/SDLTest.build/Debug/testoverlay2.build/Objects-normal/x86_64/testoverlay2_dependency_info.dat -o /Users/ericwa/Library/Developer/Xcode/DerivedData/SDLTest-hejdvjqvdzpmofapnvlpoxaroscc/Build/Products/Debug/testoverlay2 ld: warning: directory not found for option '-F/Users/ericwa/dev/SDL-Mirror/Xcode/SDLTest/../SDL/build/Debug' ld: warning: directory not found for option '-F/Users/ericwa/Library/Frameworks' Undefined symbols for architecture x86_64: "_MTLCreateSystemDefaultDevice", referenced from: _METAL_CreateRenderer in libSDL2.a(SDL_render_metal.o) _IsMetalAvailable in libSDL2.a(SDL_render_metal.o) "_OBJC_CLASS_$_MTLRenderPassDescriptor", referenced from: objc-class-ref in libSDL2.a(SDL_render_metal.o) "_OBJC_CLASS_$_MTLRenderPipelineDescriptor", referenced from: objc-class-ref in libSDL2.a(SDL_render_metal.o) "_OBJC_CLASS_$_MTLSamplerDescriptor", referenced from: objc-class-ref in libSDL2.a(SDL_render_metal.o) "_OBJC_CLASS_$_MTLTextureDescriptor", referenced from: objc-class-ref in libSDL2.a(SDL_render_metal.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ```