an error occurred in building for iOS
mpv version and platform
the last version, 0.27.0-UNKNOWN I built mpv for iOS(last iOS11) on my mac(Sierra 10.12.6)
Reproduction steps
At first, I configured some environment like: export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/:$PATH" export SDKPATH="$(xcodebuild -sdk iphoneos -version Path)" export CFLAGS="-isysroot $SDKPATH -arch arm64 -mios-version-min=9.0.0 -fembed-bitcode" export LDFLAGS="-isysroot $SDKPATH -arch arm64 -Wl,-ios_version_min,9.0.0 -lbz2"
Then, ./waf configure --disable-cplayer --disable-lcms2 --disable-lua --enable-libmpv-static --enable-ios-gl --enable-gl
Finally, ./waf build ,and error occurred.
Expected behavior
built success and generated static library.
Actual behavior
building failed
Log file
../video/out/opengl/video.c:984:34: warning: suggest braces around initialization of subobject [-Wmissing-braces] *vimg = (struct video_image){0}; ^ {} ../video/out/opengl/video.c:984:34: warning: suggest braces around initialization of subobject [-Wmissing-braces] *vimg = (struct video_image){0}; ^ {} ../video/out/opengl/video.c:1149:28: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct vertex va[6] = {0}; ^ {} ../video/out/opengl/video.c:1149:28: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct vertex va[6] = {0}; ^ {} ../video/out/opengl/video.c:3162:45: warning: suggest braces around initialization of subobject [-Wmissing-braces] *out = (struct voctrl_performance_data){0}; ^ {} 5 warnings generated.
../player/playloop.c:696:19: error: 'system' is unavailable: not available on iOS (void)system(opts->heartbeat_cmd); ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/include/stdlib.h:195:6: note: 'system' has been explicitly marked unavailable here int system(const char *) __DARWIN_ALIAS_C(system); ^ 1 error generated.
Waf: Leaving directory `/Users/admin-5/mpv_git/mpv/build'
Build failed
-> task in 'mpv' failed with exit status 1 (run with -v to display more information)

Strange, I'm sure this worked for other people who built it for iOS.
Anyway, can be solved by removing the old heartbeat option, which I will do some time this week I guess.
Actually did it right now.
@wm4 it worked!!! Thank you very very much~~~
@wm4 Would you tell me how can I build other architectures , just like armv7?
@wm4 emmmm, sadly, I build failed.Is there any possibility that I have generated a wrong or half-baked static library.
Non-fat file: /Users/admin-5/yhtx_ios/Developer/chainebox/ThirdPartyLib/lib/mpv/libmpv.a is architecture: arm64
And I make sure that I have imported libmpv.a into my project.
@wm4 Just for info, "system" have been deprecated since iOS 8 and removed in xCode 9, that's why it worked before.
@ZSwitch Hey, did you find a solution to this problem? I have the exact same issue.
Undefined symbols for architecture arm64:
"_mpv_create", referenced from:
-[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@AngeloWalczak , Did you find a solution?
@AngeloWalczak , Did you find a solution?
I don't remember, it was 2 years ago. But the project spec changed and we moved on with something else.