[GRASS-dev] build error in lib/ogsf

Hi All,

tring to build grass-trunk on a ubuntu-11.10 64bit
i had this error in the osgf library :

epifanio@epinux:~/src/gis/grass/lib/ogsf$ make
gcc -g -O2 -fPIC -I/home/epifanio/src/gis/grass/dist.x86_64-unknown-linux-gnu/include -I/home/epifanio/src/gis/grass/dist.x86_64-unknown-linux-gnu/include -D_FILE_OFFSET_BITS=64 -I/home/epifanio/dev/local/include -I/usr/include -DPACKAGE="“grasslibs”" -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libavutil -I/usr/include/libswscale -I/home/epifanio/src/gis/grass/dist.x86_64-unknown-linux-gnu/include -I/home/epifanio/src/gis/grass/dist.x86_64-unknown-linux-gnu/include -o OBJ.x86_64-unknown-linux-gnu/gsd_img_mpeg.o -c gsd_img_mpeg.c
gsd_img_mpeg.c: In function ‘add_video_stream’:
gsd_img_mpeg.c:69:21: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
gsd_img_mpeg.c:69:21: note: each undeclared identifier is reported only once for each function it appears in
gsd_img_mpeg.c: In function ‘write_video_frame’:
gsd_img_mpeg.c:218:15: error: ‘PKT_FLAG_KEY’ undeclared (first use in this function)
gsd_img_mpeg.c: In function ‘gsd_init_mpeg’:
gsd_img_mpeg.c:304:9: warning: assignment makes pointer from integer without a cast [enabled by default]
gsd_img_mpeg.c:307:6: warning: assignment makes pointer from integer without a cast [enabled by default]
gsd_img_mpeg.c:315:8: warning: assignment makes pointer from integer without a cast [enabled by default]
gsd_img_mpeg.c:336:5: warning: ‘av_set_parameters’ is deprecated (declared at /usr/include/libavformat/avformat.h:1329) [-Wdeprecated-declarations]
gsd_img_mpeg.c:341:5: warning: ‘dump_format’ is deprecated (declared at /usr/include/libavformat/avformat.h:1451) [-Wdeprecated-declarations]
gsd_img_mpeg.c:350:2: warning: ‘url_fopen’ is deprecated (declared at /usr/include/libavformat/avio.h:278) [-Wdeprecated-declarations]
gsd_img_mpeg.c:357:5: warning: ‘av_write_header’ is deprecated (declared at /usr/include/libavformat/avformat.h:1387) [-Wdeprecated-declarations]
gsd_img_mpeg.c: In function ‘gsd_close_mpeg’:
gsd_img_mpeg.c:442:2: warning: ‘url_fclose’ is deprecated (declared at /usr/include/libavformat/avio.h:279) [-Wdeprecated-declarations]
make: *** [OBJ.x86_64-unknown-linux-gnu/gsd_img_mpeg.o] Error 1
epifanio@epinux:~/src/gis/grass/lib/ogsf$

seems something is wrong or missed in my ffmpeg libs, have you any clue on how to fix it ?

thanks!

–Massimo.

massimo di stefano wrote:

tring to build grass-trunk on a ubuntu-11.10 64bit
i had this error in the osgf library :

gsd_img_mpeg.c: In function �add_video_stream�:
gsd_img_mpeg.c:69:21: error: �CODEC_TYPE_VIDEO� undeclared (first use in this function)

avcodec.h has this:

  #if LIBAVCODEC_VERSION_MAJOR < 53
  #define CodecType AVMediaType
  
  #define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN
  #define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
  #define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
  #define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA
  #define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE
  #define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
  #define CODEC_TYPE_NB AVMEDIA_TYPE_NB
  #endif

So it appears that CODEC_TYPE_* have been deprecated in favour of
AVMEDIA_TYPE_*, and have been removed altogethr in version 53.
Similarly for:

  #define AV_PKT_FLAG_KEY 0x0001
  #if LIBAVCODEC_VERSION_MAJOR < 53
  #define PKT_FLAG_KEY AV_PKT_FLAG_KEY
  #endif

As you might have guessed from "version 53", ffmpeg tends to change
quite frequently.

The question for us is whether the "new" names have been in use long
enough that we can just change the code to use the new names, or
whether that will break compilation for anyone using last week's
version of ffmpeg.

In the meantime, you can just drop --with-ffmpeg if you don't actually
need to generate video files from NVIZ.

--
Glynn Clements <glynn@gclements.plus.com>