KelvinJin/libsox-iOS

Build is failing Xcode 10.2

Microbee23 opened this issue · 1 comments

Hi thanks for providing this script

I have tried following the README and run the script provided but have run into errors during the build process.

I am running XCode 10.2 - not sure if this is relevant

Please find a copy of the error log - any help would be appreciated - thanks!

ld: warning: ignoring file /usr/local/Cellar/opusfile/0.11/lib/libopusfile.dylib, file was built for x86_64 which is not the architecture being linked (arm64): /usr/local/Cellar/opusfile/0.11/lib/libopusfile.dylib
Undefined symbols for architecture arm64:
"_op_channel_count", referenced from:
_startread in libsox.a(libsox_la-opus.o)
"_op_free", referenced from:
_stopread in libsox.a(libsox_la-opus.o)
"_op_open_callbacks", referenced from:
_startread in libsox.a(libsox_la-opus.o)
"_op_pcm_seek", referenced from:
_seek in libsox.a(libsox_la-opus.o)
"_op_pcm_total", referenced from:
_startread in libsox.a(libsox_la-opus.o)
"_op_read", referenced from:
_read_samples in libsox.a(libsox_la-opus.o)
"_op_tags", referenced from:
_startread in libsox.a(libsox_la-opus.o)

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [sox] Error 1
make: *** [install-recursive] Error 1
cp: /Users/frog/Workspace/Sox-iOS/sox-code/iOS-arm64/lib/libsox.a: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: build/* (No such file or directory)

Hey @Microbee23, looking at the error, it seems you have the opusfile library installed via Homebrew which I don't have locally so that might be the cause. It seems the version installed by Homebrew doesn't come with the arm64 architecture.

My suggestion is to remove that opusfile version by using brew remove opusfile and let the system handles it.

Sorry I don't have this issue locally so I can't reproduce. But let me know if this helps? You can also use the prebuilt version I have in Google Drive. It's old but should still work for most situations.