Problem building pjsip 2.0.1 for 64-bit Ubuntu 12.04

KR
Ken Resander
Tue, Nov 13, 2012 11:15 AM

My ageing 32-bit PC suddenly gave up on me and I had to find a 64-bit PC replacement in a hurry. All pjsip libraries and applications built without errors for pjsip 2.0 beta on the 32-bit PC, so could this problem be caused by building for 64-bit which is something I have never done before for any project.

However, installation of 64-bit Ubuntu 12-04 LTS on the PC was straightforward and also seemed to directly or indirectly install some ffmpeg libavxxx libraries like:

/usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0
/usr/lib/x86_64-linux-gnu/libavformat.so.53.21.0
/usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1

I did not rebuild/build ffmpeg from source. Do I need to for Ubuntu 12.04?
However, I fetched sources SDL-2.0.tar.gz and these compiled and built OK.

Downloaded pjproject-2.0.1.tar.bz2 from pjsip.org and unpacked to directory pjsip201d/pjproject-2.0.1.
Then added #define PJMEDIA_HAS_VIDEO 1 to config_site.h in pjlib/include/pj and ran:

./configure CFLAGS='-g'
make dep
make

I am attaching the complete command-line log for these as file mylogconfmakedepmake.
Configure and make dep seemed to run ok, but make ended with error at this compile step:

gcc -c -Wall -DPJ_AUTOCONF=1 -g -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1   -DPJMEDIA_VIDEO_DEV_HAS_SDL=1 -I/usr/local/include/SDL2 -D_REENTRANT -DPJMEDIA_HAS_LIBAVFORMAT=1 -DPJMEDIA_HAS_LIBAVCODEC=1 -DPJMEDIA_HAS_LIBSWSCALE=1 -DPJMEDIA_HAS_LIBAVUTIL=1 -I/usr/local/include       -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/speex -I/home/ken/pjs201d/pjproject-2.0.1/third_party/speex/include -DPJMEDIA_HAS_OPENCORE_AMRNB_CODEC=0 -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/portaudio -I/home/ken/pjs201d/pjproject-2.0.1/third_party/portaudio/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 -I../include -I../../pjlib/include -I../../pjlib-util/include -I../../pjmedia/include -I../../pjnath/include -I../.. -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/srtp -I/home/ken/pjs201d/pjproject-2.0.1/third_party/srtp/crypto/include -I/home/ken/pjs201d/pjproject-2.0.1/third_party/srtp/include     
-I/home/ken/pjs201d/pjproject-2.0.1/third_party
        -o output/pjmedia-codec-x86_64-unknown-linux-gnu/ffmpeg_vid_codecs.o
        ../src/pjmedia-codec/ffmpeg_vid_codecs.c
../src/pjmedia-codec/ffmpeg_vid_codecs.c: In function ‘pjmedia_codec_ffmpeg_vid_init’:
../src/pjmedia-codec/ffmpeg_vid_codecs.c:659:7: error: ‘AVCodec’ has no member named ‘encode’
../src/pjmedia-codec/ffmpeg_vid_codecs.c:667:21: error: ‘AVCodec’ has no member named ‘encode’
../src/pjmedia-codec/ffmpeg_vid_codecs.c:732:6: error: ‘AVCodec’ has no member named ‘encode’
make[2]: *** [output/pjmedia-codec-x86_64-unknown-linux-gnu/ffmpeg_vid_codecs.o] Error 1
make[2]: Leaving directory /home/ken/pjs201d/pjproject-2.0.1/pjmedia/build' make[1]: *** [pjmedia-codec] Error 2 make[1]: Leaving directory /home/ken/pjs201d/pjproject-2.0.1/pjmedia/build'
make: *** [all] Error 1
ken@kr-Vostro-260:~/pjs201d/pjproject-2.0.1$

The pjsip build produced many/all? of the pjsip libraries:

  libpj-x86_64-linux-unknown-linux-gnu.a                  for pjlib
  libpjlib-util-x86_64-linux-unknown-linux-gnu.a          for pjlib-util
  libpjmedia-audiodev-x86_64-linux-unknown-linux-gnu.a    for pjmedia
  libpjmedia-videodev-x86_64-linux-unknown-linux-gnu.a
  libpjmedia-x86_64-linux-unknown-linux-gnu.a         
  libpjnath-x86_64-linux-unknown-linux-gnu.a              for pjnath
  libpjsip-simple-x86_64-unknown-linux-gnu.a              for pjsip
  libpjsip-ua-x86_64-unknown-linux-gnu.a
  libpjsip-x86_64-unknown-linux-gnu.a
  libpjsua-x86_64-unknown-linux-gnu.a
  libg7221codec-x86_64-unknown-linux-gnu.a                for third-party libs
  libgsmcodec-x86_64-unknown-linux-gnu.a
  libilbccodec-x86_64-unknown-linux-gnu.a
  libmilenage-x86_64-unknown-linux-gnu.a
  libportaudio-x86_64-unknown-linux-gnu.a
  libresample-x86_64-unknown-linux-gnu.a
  libspeex-x86_64-unknown-linux-gnu.a
  libsrtp-x86_64-unknown-linux-gnu.a

but the build did not generate any applications or samples, maybe because of the ‘AVCodec’ compilation error. I do not understand what is causing this, so would be very grateful for advice.

Ken
 

My ageing 32-bit PC suddenly gave up on me and I had to find a 64-bit PC replacement in a hurry. All pjsip libraries and applications built without errors for pjsip 2.0 beta on the 32-bit PC, so could this problem be caused by building for 64-bit which is something I have never done before for any project. However, installation of 64-bit Ubuntu 12-04 LTS on the PC was straightforward and also seemed to directly or indirectly install some ffmpeg libavxxx libraries like: /usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0 /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.0 /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1 I did not rebuild/build ffmpeg from source. Do I need to for Ubuntu 12.04? However, I fetched sources SDL-2.0.tar.gz and these compiled and built OK. Downloaded pjproject-2.0.1.tar.bz2 from pjsip.org and unpacked to directory pjsip201d/pjproject-2.0.1. Then added #define PJMEDIA_HAS_VIDEO 1 to config_site.h in pjlib/include/pj and ran: ./configure CFLAGS='-g' make dep make I am attaching the complete command-line log for these as file mylogconfmakedepmake. Configure and make dep seemed to run ok, but make ended with error at this compile step: gcc -c -Wall -DPJ_AUTOCONF=1 -g -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1   -DPJMEDIA_VIDEO_DEV_HAS_SDL=1 -I/usr/local/include/SDL2 -D_REENTRANT -DPJMEDIA_HAS_LIBAVFORMAT=1 -DPJMEDIA_HAS_LIBAVCODEC=1 -DPJMEDIA_HAS_LIBSWSCALE=1 -DPJMEDIA_HAS_LIBAVUTIL=1 -I/usr/local/include       -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/speex -I/home/ken/pjs201d/pjproject-2.0.1/third_party/speex/include -DPJMEDIA_HAS_OPENCORE_AMRNB_CODEC=0 -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/portaudio -I/home/ken/pjs201d/pjproject-2.0.1/third_party/portaudio/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 -I../include -I../../pjlib/include -I../../pjlib-util/include -I../../pjmedia/include -I../../pjnath/include -I../.. -I/home/ken/pjs201d/pjproject-2.0.1/third_party/build/srtp -I/home/ken/pjs201d/pjproject-2.0.1/third_party/srtp/crypto/include -I/home/ken/pjs201d/pjproject-2.0.1/third_party/srtp/include      -I/home/ken/pjs201d/pjproject-2.0.1/third_party \         -o output/pjmedia-codec-x86_64-unknown-linux-gnu/ffmpeg_vid_codecs.o \         ../src/pjmedia-codec/ffmpeg_vid_codecs.c ../src/pjmedia-codec/ffmpeg_vid_codecs.c: In function ‘pjmedia_codec_ffmpeg_vid_init’: ../src/pjmedia-codec/ffmpeg_vid_codecs.c:659:7: error: ‘AVCodec’ has no member named ‘encode’ ../src/pjmedia-codec/ffmpeg_vid_codecs.c:667:21: error: ‘AVCodec’ has no member named ‘encode’ ../src/pjmedia-codec/ffmpeg_vid_codecs.c:732:6: error: ‘AVCodec’ has no member named ‘encode’ make[2]: *** [output/pjmedia-codec-x86_64-unknown-linux-gnu/ffmpeg_vid_codecs.o] Error 1 make[2]: Leaving directory `/home/ken/pjs201d/pjproject-2.0.1/pjmedia/build' make[1]: *** [pjmedia-codec] Error 2 make[1]: Leaving directory `/home/ken/pjs201d/pjproject-2.0.1/pjmedia/build' make: *** [all] Error 1 ken@kr-Vostro-260:~/pjs201d/pjproject-2.0.1$ The pjsip build produced many/all? of the pjsip libraries:   libpj-x86_64-linux-unknown-linux-gnu.a                  for pjlib   libpjlib-util-x86_64-linux-unknown-linux-gnu.a          for pjlib-util   libpjmedia-audiodev-x86_64-linux-unknown-linux-gnu.a    for pjmedia   libpjmedia-videodev-x86_64-linux-unknown-linux-gnu.a   libpjmedia-x86_64-linux-unknown-linux-gnu.a            libpjnath-x86_64-linux-unknown-linux-gnu.a              for pjnath   libpjsip-simple-x86_64-unknown-linux-gnu.a              for pjsip   libpjsip-ua-x86_64-unknown-linux-gnu.a   libpjsip-x86_64-unknown-linux-gnu.a   libpjsua-x86_64-unknown-linux-gnu.a   libg7221codec-x86_64-unknown-linux-gnu.a                for third-party libs   libgsmcodec-x86_64-unknown-linux-gnu.a   libilbccodec-x86_64-unknown-linux-gnu.a   libmilenage-x86_64-unknown-linux-gnu.a   libportaudio-x86_64-unknown-linux-gnu.a   libresample-x86_64-unknown-linux-gnu.a   libspeex-x86_64-unknown-linux-gnu.a   libsrtp-x86_64-unknown-linux-gnu.a but the build did not generate any applications or samples, maybe because of the ‘AVCodec’ compilation error. I do not understand what is causing this, so would be very grateful for advice. Ken