untrunc
untrunc copied to clipboard
Compile Error
Happy Sunshine! I am very excited to see how untrunc will work for my corrupted Lumix files from a wedding. I am installing this on Linux Mint 18.2 Cinnamon. I have Libav 12.2 installed. (I have tried Libav 12.3 as well).
I have whittled down a long list of compile errors with the information in this github. Unfortunately, I have a few compile errors remaining and I haven't found the right ideas yet to get past this snag. I am very much hoping one of you has some further guidance for me.
The bash command I am using for compiling untrunc:
dani@HappySunshine ~/untrunc-master $ g++ -std=c++11 -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil -lavresample -lpthread -lz -lbz2
Here is the output from the compile attempt:
mp4.cpp: In member function ‘void Mp4::parseTracks()’:
mp4.cpp:283:47: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
Track track(traks[i], context_->streams[i]->codec);
^
In file included from mp4.cpp:28:0:
/usr/local/include/libavformat/avformat.h:712:21: note: declared here
AVCodecContext *codec;
^
mp4.cpp:283:47: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
Track track(traks[i], context_->streams[i]->codec);
^
In file included from mp4.cpp:28:0:
/usr/local/include/libavformat/avformat.h:712:21: note: declared here
AVCodecContext *codec;
^
mp4.cpp:283:47: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
Track track(traks[i], context_->streams[i]->codec);
^
In file included from mp4.cpp:28:0:
/usr/local/include/libavformat/avformat.h:712:21: note: declared here
AVCodecContext *codec;
^
/tmp/ccTZxPst.o: In function `FileRead::readInt()':
file.cpp:(.text+0x6cc): undefined reference to `swap32(unsigned int)'
/tmp/ccTZxPst.o: In function `FileRead::readInt64()':
file.cpp:(.text+0x7a6): undefined reference to `swap64(unsigned long)'
/tmp/ccTZxPst.o: In function `FileWrite::writeInt(int)':
file.cpp:(.text+0xb51): undefined reference to `swap32(unsigned int)'
/tmp/ccTZxPst.o: In function `FileWrite::writeInt64(long)':
file.cpp:(.text+0xb98): undefined reference to `swap64(unsigned long)'
/tmp/ccTZxPst.o: In function `void logg<char const (&) [11], unsigned long, char const (&) [14], long&, char>(LogMode, char const (&) [11], unsigned long&&, char const (&) [14], long&, char&&)':
file.cpp:(.text._Z4loggIJRA11_KcmRA14_S0_RlcEEv7LogModeDpOT_[_Z4loggIJRA11_KcmRA14_S0_RlcEEv7LogModeDpOT_]+0x28): undefined reference to `g_log_mode'
/tmp/ccTZxPst.o: In function `void logg<char const (&) [30]>(LogMode, char const (&) [30])':
file.cpp:(.text._Z4loggIJRA30_KcEEv7LogModeDpOT_[_Z4loggIJRA30_KcEEv7LogModeDpOT_]+0x11): undefined reference to `g_log_mode'
/tmp/ccTZxPst.o: In function `void logg<char const (&) [17], int&, char>(LogMode, char const (&) [17], int&, char&&)':
file.cpp:(.text._Z4loggIJRA17_KcRicEEv7LogModeDpOT_[_Z4loggIJRA17_KcRicEEv7LogModeDpOT_]+0x1c): undefined reference to `g_log_mode'
/tmp/ccbT1itI.o: In function `main':
main.cpp:(.text+0x1b1): undefined reference to `g_log_mode'
main.cpp:(.text+0x1da): undefined reference to `g_log_mode'
/tmp/ccbT1itI.o:main.cpp:(.text+0x203): more undefined references to `g_log_mode' follow
/tmp/cccTfHOY.o: In function `Track::Track(Atom*, AVCodecContext*)':
track.cpp:(.text+0x3d): undefined reference to `Codec::Codec(AVCodecContext*)'
/tmp/cccTfHOY.o: In function `Track::parse(Atom*)':
track.cpp:(.text+0x73b): undefined reference to `Codec::parse(Atom*, std::vector<int, std::allocator<int> >&, Atom*)'
/tmp/ccJqBwLg.o: In function `Atom::readInt(long)':
atom.cpp:(.text+0x26b0): undefined reference to `swap32(unsigned int)'
/tmp/ccJqBwLg.o: In function `Atom::writeInt(int, long)':
atom.cpp:(.text+0x2723): undefined reference to `swap32(unsigned int)'
/tmp/ccJqBwLg.o: In function `void logg<char const (&) [10], long&, char>(LogMode, char const (&) [10], long&, char&&)':
atom.cpp:(.text._Z4loggIJRA10_KcRlcEEv7LogModeDpOT_[_Z4loggIJRA10_KcRlcEEv7LogModeDpOT_]+0x1c): undefined reference to `g_log_mode'
/tmp/ccJqBwLg.o: In function `void logg<char const (&) [11], long&, char>(LogMode, char const (&) [11], long&, char&&)':
atom.cpp:(.text._Z4loggIJRA11_KcRlcEEv7LogModeDpOT_[_Z4loggIJRA11_KcRlcEEv7LogModeDpOT_]+0x1c): undefined reference to `g_log_mode'
/tmp/ccJqBwLg.o: In function `void logg<char const (&) [9], char (&) [5], char>(LogMode, char const (&) [9], char (&) [5], char&&)':
atom.cpp:(.text._Z4loggIJRA9_KcRA5_ccEEv7LogModeDpOT_[_Z4loggIJRA9_KcRA5_ccEEv7LogModeDpOT_]+0x1c): undefined reference to `g_log_mode'
/tmp/ccJqBwLg.o: In function `void logg<char>(LogMode, char&&)':
atom.cpp:(.text._Z4loggIJcEEv7LogModeDpOT_[_Z4loggIJcEEv7LogModeDpOT_]+0x11): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `Mp4::parseOk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
mp4.cpp:(.text+0x47b): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `Mp4::analyze()':
mp4.cpp:(.text+0x1e3a): undefined reference to `Codec::matchSample(unsigned char const*)'
mp4.cpp:(.text+0x1e68): undefined reference to `Codec::getLength(unsigned char const*, int, int&)'
/tmp/cccNYzsA.o: In function `Mp4::repair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
mp4.cpp:(.text+0x2779): undefined reference to `g_log_mode'
mp4.cpp:(.text+0x2862): undefined reference to `g_max_partsize'
mp4.cpp:(.text+0x286e): undefined reference to `g_max_partsize'
mp4.cpp:(.text+0x29c7): undefined reference to `swap32(unsigned int)'
mp4.cpp:(.text+0x29fc): undefined reference to `swap32(unsigned int)'
mp4.cpp:(.text+0x2ade): undefined reference to `Codec::matchSample(unsigned char const*)'
mp4.cpp:(.text+0x2b28): undefined reference to `Codec::getLength(unsigned char const*, int, int&)'
mp4.cpp:(.text+0x2b73): undefined reference to `g_max_partsize'
mp4.cpp:(.text+0x2e1b): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `void logg<char const (&) [32]>(LogMode, char const (&) [32])':
mp4.cpp:(.text._Z4loggIJRA32_KcEEv7LogModeDpOT_[_Z4loggIJRA32_KcEEv7LogModeDpOT_]+0x11): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `void logg<char const (&) [13], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char const (&) [4], double, char const (&) [3]>(LogMode, char const (&) [13], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char const (&) [4], double&&, char const (&) [3])':
mp4.cpp:(.text._Z4loggIJRA13_KcRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA4_S0_dRA3_S0_EEv7LogModeDpOT_[_Z4loggIJRA13_KcRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA4_S0_dRA3_S0_EEv7LogModeDpOT_]+0x28): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `void logg<char const (&) [8], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char>(LogMode, char const (&) [8], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char&&)':
mp4.cpp:(.text._Z4loggIJRA8_KcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEEv7LogModeDpOT_[_Z4loggIJRA8_KcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEEv7LogModeDpOT_]+0x1c): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o: In function `void logg<char const (&) [39]>(LogMode, char const (&) [39])':
mp4.cpp:(.text._Z4loggIJRA39_KcEEv7LogModeDpOT_[_Z4loggIJRA39_KcEEv7LogModeDpOT_]+0x11): undefined reference to `g_log_mode'
/tmp/cccNYzsA.o:mp4.cpp:(.text._Z4loggIJRA21_KclcEEv7LogModeDpOT_[_Z4loggIJRA21_KclcEEv7LogModeDpOT_]+0x1c): more undefined references to `g_log_mode' follow
collect2: error: ld returned 1 exit status
dani@HappySunshine ~/untrunc-master $
Thank you for your thyme and suggestions!
Much Love, Dani