kewlbear/FFmpeg-iOS-build-script

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

chaosVoid opened this issue · 4 comments

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~

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)

Import ffmpeg_hw.c file to solve

Great job.

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)