New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an error occurred in building for iOS #4888

Closed
ZSwitch opened this Issue Sep 18, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@ZSwitch

ZSwitch commented Sep 18, 2017

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)
qq20170918-182424 2x

@wm4

This comment has been minimized.

Contributor

wm4 commented Sep 18, 2017

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.

@wm4 wm4 closed this in 80e3173 Sep 18, 2017

@wm4

This comment has been minimized.

Contributor

wm4 commented Sep 18, 2017

Actually did it right now.

@ZSwitch

This comment has been minimized.

ZSwitch commented Sep 19, 2017

@wm4 it worked!!! Thank you very very much~~~

@ZSwitch

This comment has been minimized.

ZSwitch commented Sep 19, 2017

@wm4 Would you tell me how can I build other architectures , just like armv7?

@ZSwitch

This comment has been minimized.

ZSwitch commented Sep 19, 2017

@wm4 emmmm, sadly, I build failed.Is there any possibility that I have generated a wrong or half-baked static library.
qq20170919-115636 2x
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.

@skrew

This comment has been minimized.

skrew commented Oct 14, 2017

@wm4 Just for info, "system" have been deprecated since iOS 8 and removed in xCode 9, that's why it worked before.

@AngeloWalczak

This comment has been minimized.

AngeloWalczak commented Feb 14, 2018

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment