kewlbear / FFmpeg-iOS-build-script

Shell scripts to build FFmpeg for iOS and tvOS
3.03k stars 899 forks source link

error(in libavdevice.a):Undefined symbols for architecture x86_64: #141

Closed chaosVoid closed 5 years ago

chaosVoid commented 5 years ago

Hello, I get this Linker Error while building for simulator or device. xcode版本:10.1 ffmpeg版本:4.1 image I have added the following frameworks & libraries libz、libbz2、libiconv、CoreVideo、CoreMedia、VideoToolbox、AVFoundation、 Compile command ./build-ffmpeg.sh

Header Search Paths tiānjiāle $(SRCROOT)/$(PROJECT)/FFmpeg-iOS/include Library Search Paths tiānjiāle $(SRCROOT)/$(PROJECT)/FFmpeg-iOS/lib I am new to ffmpeg . Could anyone help me to solve this problem ,thanks~

chaosVoid commented 5 years ago

After I compiled and imported SDL2, it became the following error.

Undefined symbols for architecture x86_64: "_hwaccel_decode_init", referenced from: _get_format in ffmpeg.o "_hw_device_setup_for_encode", referenced from: _init_output_stream in ffmpeg.o "_hw_device_setup_for_decode", referenced from: _init_input_stream in ffmpeg.o "_hw_device_free_all", referenced from: _transcode in ffmpeg.o "_hw_device_get_by_name", referenced from: _opt_filter_hw_device in ffmpeg_opt.o "_hw_device_init_from_string", referenced from: _opt_init_hw_device in ffmpeg_opt.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

chaosVoid commented 5 years ago

Import ffmpeg_hw.c file to solve

SamanGrant commented 5 years ago

Great job.

Sanchain commented 5 years ago

Import ffmpeg_hw.c file to solve

good job! Have you encountered this error?

duplicate symbol _main in: /Users/sanchainzeng/Library/Developer/Xcode/DerivedData/FFMPEG-etftnlhtrcvvzgfzgnwlywpgugnk/Build/Intermediates.noindex/FFMPEG.build/Debug-iphoneos/FFMPEG.build/Objects-normal/arm64/main.o /Users/sanchainzeng/Library/Developer/Xcode/DerivedData/FFMPEG-etftnlhtrcvvzgfzgnwlywpgugnk/Build/Intermediates.noindex/FFMPEG.build/Debug-iphoneos/FFMPEG.build/Objects-normal/arm64/ffmpeg.o ld: 1 duplicate symbol for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)