untrunc
untrunc copied to clipboard
(OSX 10.11.6) clang: error: linker command failed with exit code 1
Hi all! I tried to compile untrunc on OSX 10.11.6 with libav-12.3, using the instructions in README.md, but when I launch
g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -I./libav-12.3 -L./libav-12.3/libavformat -lavformat -L./libav-12.3/libavcodec -lavcodec -L./libav-12.3/libavutil -lavutil -lpthread -lz -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2 -DOSX
I obtain the error below.
Undefined symbols for architecture x86_64:
"_avresample_alloc_context", referenced from:
_opus_decode_init in libavcodec.a(opusdec.o)
"_avresample_close", referenced from:
_opus_decode_packet in libavcodec.a(opusdec.o)
_opus_decode_flush in libavcodec.a(opusdec.o)
"_avresample_convert", referenced from:
_opus_decode_packet in libavcodec.a(opusdec.o)
"_avresample_free", referenced from:
_opus_decode_close in libavcodec.a(opusdec.o)
"_avresample_is_open", referenced from:
_opus_decode_packet in libavcodec.a(opusdec.o)
"_avresample_open", referenced from:
_opus_decode_packet in libavcodec.a(opusdec.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I solve? Thank you.
Ivan
Solved! I added the path for resample!
Getting the same error on 10.11.6. Can you please describe what you mean by "adding the path for resample"?
Figured. Append -L./libav-12.3/libavresample -lavresample to the g++ command, making it:
g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -I./libav-12.3 -L./libav-12.3/libavformat -lavformat -L./libav-12.3/libavcodec -lavcodec -L./libav-12.3/libavutil -lavutil -L./libav-12.3/libavresample -lavresample -lpthread -lz -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2 -DOSX
I simply use make on this fork. I somehow really like that fork!