Error while commpiling: FFmpeg

Hi,

I’m trying to compile audacity 2.1.0 from the source tarball.

System information:
lenovo thinkpad x220
Intel i5-2540m
Debian Wheezy x86_64
Kernel: 3.2.65-1+deb7u2

Dependencies listed in http://wiki.audacityteam.org/wiki/Developing_On_Linux :
wxGTK: 2.8.12 (compiled from source)
libsndfile: 1.0.25 (compiled from source)

Dependancies installed from sudo apt-get build-dep audacity (all from debian repo):
libasound2: 1.0.25-4
libavcodec53: 6:0.8.17-1
libavformat53: 6:0.8.17-1
libavutil51: 6:0.8.17-1
libc6: 2.13-38+deb7u8
libexpat1: 2.1.0-1+deb7u1
libflac++6: 1.2.1-6+deb7u1
libflac8: 1.2.1-6+deb7u1
libgcc1: 1:4.7.2-5
libglib2.0-0: 2.33.12+really2.32.4-5
libgtk2.0-0: 2.24.10-2
libid3tag0: 0.15.1b-10
libmad0: 0.15.1b-7
libmp3lame0: 3.99.5+repack1-3
libogg0: 1.3.0-4
libportaudio2: 19+svn20111121-1
libportsmf0: 0.1~svn20101010-3
libsamplerate0: 0.1.8-5
libsbsms10: 2.0.1-1
libsndfile1: 1.0.25-5
libsoundtouch0: 1.6.0-3
libstdc++6: 4.7.2-5
libtwolame0: 0.3.13-1
libvamp-hostsdk3: 2.1-1
libvorbis0a: 1.3.2-1.3
libvorbisenc2: 1.3.2-1.3
libvorbisfile3: 1.3.2-1.3
libwxbase2.8-0: 2.8.12.1-12
libwxgtk2.8-0: 2.8.12.1-12

These are the errors I encountered during the compiling:

In file included from AudacityApp.cpp:73:0:
FFmpeg.h:564:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h:564:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h: In function ‘AVCodec* avcodec_find_encoder(int)’:
FFmpeg.h:564:4: error: declaration of C function ‘AVCodec* avcodec_find_encoder(int)’ conflicts with
In file included from FFmpeg.h:43:0,
from AudacityApp.cpp:73:
/usr/include/libavcodec/avcodec.h:3831:10: error: previous declaration ‘AVCodec* avcodec_find_encoder(CodecID)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: At global scope:
FFmpeg.h:576:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h:576:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h: In function ‘AVCodec* avcodec_find_decoder(int)’:
FFmpeg.h:576:4: error: declaration of C function ‘AVCodec* avcodec_find_decoder(int)’ conflicts with
In file included from FFmpeg.h:43:0,
from AudacityApp.cpp:73:
/usr/include/libavcodec/avcodec.h:3847:10: error: previous declaration ‘AVCodec* avcodec_find_decoder(CodecID)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: At global scope:
FFmpeg.h:582:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h:582:4: error: use of enum ‘AVCodecID’ without previous declaration
FFmpeg.h: In function ‘unsigned int av_codec_get_tag(const AVCodecTag* const*, int)’:
FFmpeg.h:582:4: error: declaration of C function ‘unsigned int av_codec_get_tag(const AVCodecTag* const*, int)’ conflicts with
In file included from FFmpeg.h:44:0,
from AudacityApp.cpp:73:
/usr/include/libavformat/avformat.h:1851:14: error: previous declaration ‘unsigned int av_codec_get_tag(const AVCodecTag* const*, CodecID)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: In function ‘int avcodec_open2(AVCodecContext*, const AVCodec*, AVDictionary**)’:
FFmpeg.h:588:4: error: declaration of C function ‘int avcodec_open2(AVCodecContext*, const AVCodec*, AVDictionary**)’ conflicts with
In file included from FFmpeg.h:43:0,
from AudacityApp.cpp:73:
/usr/include/libavcodec/avcodec.h:4074:5: error: previous declaration ‘int avcodec_open2(AVCodecContext*, AVCodec*, AVDictionary**)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: In function ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, const AVPacket*)’:
FFmpeg.h:595:4: error: declaration of C function ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ conflicts with
In file included from FFmpeg.h:43:0,
from AudacityApp.cpp:73:
/usr/include/libavcodec/avcodec.h:4169:5: error: previous declaration ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, AVPacket*)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: In function ‘AVCodec* av_codec_next(const AVCodec*)’:
FFmpeg.h:694:4: error: declaration of C function ‘AVCodec* av_codec_next(const AVCodec*)’ conflicts with
In file included from FFmpeg.h:43:0,
from AudacityApp.cpp:73:
/usr/include/libavcodec/avcodec.h:3789:10: error: previous declaration ‘AVCodec* av_codec_next(AVCodec*)’ here
In file included from AudacityApp.cpp:73:0:
FFmpeg.h: In function ‘AVStream* avformat_new_stream(AVFormatContext*, const AVCodec*)’:
FFmpeg.h:701:4: error: declaration of C function ‘AVStream* avformat_new_stream(AVFormatContext*, const AVCodec*)’ conflicts with
In file included from FFmpeg.h:44:0,
from AudacityApp.cpp:73:
/usr/include/libavformat/avformat.h:1274:11: error: previous declaration ‘AVStream* avformat_new_stream(AVFormatContext*, AVCodec*)’ here
AudacityApp.cpp: At global scope:
AudacityApp.cpp:214:13: warning: ‘void wxOnAssert(const wxChar*, int, const wxChar*)’ defined but not used [-Wunused-function]
make[2]: *** [audacity-AudacityApp.o] Error 1
make[2]: Leaving directory /home/tim/audacity-minsrc-2.1.0/src' make[1]: *** [all] Error 2 make[1]: Leaving directory /home/tim/audacity-minsrc-2.1.0/src’
make: *** [all-recursive] Error 1

I tried installing ffmpeg (6:0.8.17-1, from Debian repo), reconfigured and remade it, but the same errors came back.

Is there another library I’m missing or a compatibility issue or what?

Thanks in advance

Tim Angelico

Try configuring with the option:

../configure --disable-dynamic-loading

To be on the safe side, run this first:

make distclean

To ensure that all dependencies are available, run:

sudo apt-get build-dep audacity

You will probably also need cmake installed:

sudo apt-get install cmake

The “step by step” instructions should work: http://wiki.audacityteam.org/wiki/CompilingAudacityForBeginners

You will probably also need cmake installed:

I checked, it was already installed

To ensure that all dependencies are available, run:
sudo apt-get build-dep audacity

I’d already done that before I got this error.

To be on the safe side, run this first:
make distclean

Try configuring with the option:
…/configure --disable-dynamic-loading

I did these, and it came back with this error:
libtool: link: `/usr/lib/libvamp-hostsdk.la’ is not a valid libtool archive
make[2]: *** [audacity] Error 1

I followed the instructions from this post:
http://sourceforge.net/p/audacity/mailman/message/31684897/

(renamed /usr/lib/libvamp-hostsdk.la) and recompiled and it came back with:

effects/VST/VSTEffect.cpp: In member function ‘bool VSTEffect::LoadFXProgram(unsigned char**, ssize_t&, int, bool)’:
effects/VST/VSTEffect.cpp:3992:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp:4013:49: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp: In member function ‘void VSTEffect::SaveFXProgram(wxMemoryBuffer&, int)’:
effects/VST/VSTEffect.cpp:4270:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp:4270:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp:4270:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp:4270:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
effects/VST/VSTEffect.cpp: In member function ‘void VSTEffect::SaveFXB(const wxFileName&)’:
effects/VST/VSTEffect.cpp:4120:8: warning: ‘chunkSize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
effects/VST/VSTEffect.cpp: At global scope:
effects/VST/VSTEffect.cpp:1352:12: warning: ‘trappedErrorCode’ defined but not used [-Wunused-variable]
effects/VST/VSTEffect.cpp:1353:12: warning: ‘int X11TrapHandler(Display*, XErrorEvent*)’ defined but not used [-Wunused-function]
mv -f effects/VST/.deps/audacity-VSTEffect.Tpo effects/VST/.deps/audacity-VSTEffect.Po

Then a long list of package names, then:

audacity-TrackArtist.o: In function wxStringBase': /usr/local/include/wx-2.8/wx/string.h:368: undefined reference to wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)’
audacity-TrackArtist.o:/usr/local/include/wx-2.8/wx/string.h:368: more undefined references to `wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)’ follow

Then several hundred lines similar, then:

import/audacity-ImportMIDI.o: In function ImportMIDI(wxString, NoteTrack*)': /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:31: undefined reference to operator+(wchar_t const*, wxString const&)’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:31: undefined reference to operator+(wxString const&, wchar_t const*)' /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:36: undefined reference to wxString::CmpNoCase(wchar_t const*) const’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:43: undefined reference to wxFFile::wxFFile(wchar_t const*, wchar_t const*)' /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:50: undefined reference to wxString::mb_str(wxMBConv const&) const’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:62: undefined reference to wxString::AfterLast(wchar_t) const' /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:62: undefined reference to wxString::BeforeLast(wchar_t) const’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:38: undefined reference to wxString::CmpNoCase(wchar_t const*) const' import/audacity-ImportMIDI.o: In function wxStringBase’:
/usr/local/include/wx-2.8/wx/string.h:368: undefined reference to wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)' import/audacity-ImportMIDI.o: In function ImportMIDI(wxString, NoteTrack*)‘:
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:39: undefined reference to operator+(wchar_t const*, wxString const&)' /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:39: undefined reference to operator+(wxString const&, wchar_t const*)’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:36: undefined reference to wxString::CmpNoCase(wchar_t const*) const' import/audacity-ImportMIDI.o: In function wxStringBase’:
/usr/local/include/wx-2.8/wx/string.h:368: undefined reference to wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)' import/audacity-ImportMIDI.o: In function ImportMIDI(wxString, NoteTrack*)‘:
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:54: undefined reference to operator+(wchar_t const*, wxString const&)' /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:54: undefined reference to operator+(wxString const&, wchar_t const*)’
import/audacity-ImportMIDI.o: In function wxStringBase': /usr/local/include/wx-2.8/wx/string.h:368: undefined reference to wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)’
import/audacity-ImportMIDI.o: In function ImportMIDI(wxString, NoteTrack*)': /home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:45: undefined reference to operator+(wchar_t const*, wxString const&)’
/home/tim/audacity-minsrc-2.1.0/src/import/ImportMIDI.cpp:45: undefined reference to `operator+(wxString const&, wchar_t const*)’
collect2: error: ld returned 1 exit status
make[2]: *** [audacity] Error 1


My wxGTK is the latest stable (2.8.12). Googling for one of the wxStringBase errors points to this topic:

but it’s on Slackware and 5 years old and I can’t find anything useful on it.

Tim Angelico