Page 1 of 1

Build failure with GCC 8? (Fedora 28)

Posted: Sat May 12, 2018 12:20 pm
by hobbes1069
Had it building fine on Fedora 27 w/ GCC 7 but now I get this:

Code: Select all

libffabi/src/ffabi.c: In function 'ffm_audio_encode_init':
libffabi/src/ffabi.c:520:30: error: 'CODEC_FLAG_GLOBAL_HEADER' undeclared (first use in this function); did you mean 'AV_CODEC_FLAG_GLOBAL_HEADER'?
         ctx->avctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
                              ^~~~~~~~~~~~~~~~~~~~~~~~
                              AV_CODEC_FLAG_GLOBAL_HEADER
libffabi/src/ffabi.c:520:30: note: each undeclared identifier is reported only once for each function it appears in
libffabi/src/ffabi.c: In function 'ffm_audio_encode_get_info':
libffabi/src/ffabi.c:721:28: error: 'CODEC_FLAG_GLOBAL_HEADER' undeclared (first use in this function); did you mean 'AV_CODEC_FLAG_GLOBAL_HEADER'?
     if ((ctx->avctx->flags&CODEC_FLAG_GLOBAL_HEADER)!=0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~
                            AV_CODEC_FLAG_GLOBAL_HEADER
Thanks,
Richard

Re: Build failure with GCC 8? (Fedora 28)

Posted: Sun May 13, 2018 2:14 pm
by chowbok
The problem isn't GCC, it's that libavformat just updated and a variable name changed. Here's a diff:

Code: Select all

*** makemkv-oss-1.12.2/libffabi/src/ffabi.c.ORIG	2018-04-27 20:53:47.000000000 -0500
--- makemkv-oss-1.12.2/libffabi/src/ffabi.c	2018-05-13 09:11:26.215809333 -0500
***************
*** 517,523 ****
          info->profile : FF_PROFILE_UNKNOWN;
  
      if ((CodecFlags&FFM_CODEC_FLAG_GLOBAL_HEADER)!=0)
!         ctx->avctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
  
      if (argp) {
          for (i=0;argp[i];i+=2) {
--- 517,523 ----
          info->profile : FF_PROFILE_UNKNOWN;
  
      if ((CodecFlags&FFM_CODEC_FLAG_GLOBAL_HEADER)!=0)
!         ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  
      if (argp) {
          for (i=0;argp[i];i+=2) {
***************
*** 718,724 ****
      info->delay = (int32_t)ctx->avctx->delay;
      info->flags = 0;
  
!     if ((ctx->avctx->flags&CODEC_FLAG_GLOBAL_HEADER)!=0)
          info->flags |= FFM_CODEC_FLAG_GLOBAL_HEADER;
  
      return 0;
--- 718,724 ----
      info->delay = (int32_t)ctx->avctx->delay;
      info->flags = 0;
  
!     if ((ctx->avctx->flags&AV_CODEC_FLAG_GLOBAL_HEADER)!=0)
          info->flags |= FFM_CODEC_FLAG_GLOBAL_HEADER;
  
      return 0;
Apply that and it should compile okay.

Re: Build failure with GCC 8? (Fedora 28)

Posted: Mon May 14, 2018 1:48 am
by Zontar
The patch allows it to compile, but I get an error "Application failed to initialize" when I try and launch it.

Re: Build failure with GCC 8? (Fedora 28)

Posted: Tue May 15, 2018 4:28 am
by Zontar
I reinstalled Fedora 28 from scratch. That helped a lot. The series of upgrades left a bunch of cruft that made compiles not work correctly. (Like ldconfig database containing old information that no longer existed.)

Re: Build failure with GCC 8? (Fedora 28)

Posted: Sat May 19, 2018 3:32 am
by wdomburg
This looks to be due to an upgrade to ffmpeg 4.0, which versions it's libraries as .58. Fedora 27 was on ffmpeg 3.3, which is .57. Unfortunately there is only a compat library for ffmpeg 2.8, which is .56.*

Not sure there is a simple workaround here until a new makemkv-bin with makemkvconv linked against the new library is released or a compat-ffmpeg33 package is added to the repo. I may just build my own if I have to. :)

* I'm using the rpmfusion repo. Not sure if there are any alternate repos worth using these days.

Re: Build failure with GCC 8? (Fedora 28)

Posted: Sat Jun 16, 2018 8:45 pm
by papastuck
The diff from chowbok worked for me on Debian Unstable.

Re: Build failure with GCC 8? (Fedora 28)

Posted: Tue Jun 26, 2018 6:05 am
by alexb0000
chowbok wrote:The problem isn't GCC, it's that libavformat just updated and a variable name changed. Here's a diff:

Code: Select all

*** makemkv-oss-1.12.2/libffabi/src/ffabi.c.ORIG	2018-04-27 20:53:47.000000000 -0500
--- makemkv-oss-1.12.2/libffabi/src/ffabi.c	2018-05-13 09:11:26.215809333 -0500
***************
*** 517,523 ****
          info->profile : FF_PROFILE_UNKNOWN;
  
      if ((CodecFlags&FFM_CODEC_FLAG_GLOBAL_HEADER)!=0)
!         ctx->avctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
  
      if (argp) {
          for (i=0;argp[i];i+=2) {
--- 517,523 ----
          info->profile : FF_PROFILE_UNKNOWN;
  
      if ((CodecFlags&FFM_CODEC_FLAG_GLOBAL_HEADER)!=0)
!         ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  
      if (argp) {
          for (i=0;argp[i];i+=2) {
***************
*** 718,724 ****
      info->delay = (int32_t)ctx->avctx->delay;
      info->flags = 0;
  
!     if ((ctx->avctx->flags&CODEC_FLAG_GLOBAL_HEADER)!=0)
          info->flags |= FFM_CODEC_FLAG_GLOBAL_HEADER;
  
      return 0;
--- 718,724 ----
      info->delay = (int32_t)ctx->avctx->delay;
      info->flags = 0;
  
!     if ((ctx->avctx->flags&AV_CODEC_FLAG_GLOBAL_HEADER)!=0)
          info->flags |= FFM_CODEC_FLAG_GLOBAL_HEADER;
  
      return 0;
Apply that and it should compile okay.
This worked for me on Fedora 28, thanks.