[FFmpeg-devel] [FFmpeg-cvslog] lavd/decklink: Fix compile issue on OS X

James Almer jamrial at gmail.com
Sun Jun 26 22:10:48 CEST 2016


On 6/23/2016 8:08 PM, Rick Kern wrote:
> Fixes #4124: Invalid argument '-std=c99' not allowed with 'C++/ObjC++'
> C++ files fail to compile. This adds '-std=c++11' to CXX_FLAGS to fix.
>
> Signed-off-by: Rick Kern <kernrj at gmail.com>
> ---
>  common.mak | 2 +-
>  configure  | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common.mak b/common.mak
> index 59b039f..3f2096d 100644
> --- a/common.mak
> +++ b/common.mak
> @@ -39,7 +39,7 @@ CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
>  OBJCFLAGS  += $(EOBJCFLAGS)
>  OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
>  ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
> -CXXFLAGS   += $(CPPFLAGS) $(CFLAGS)
> +CXXFLAGS   := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
>  YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
>  
>  HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
> diff --git a/configure b/configure
> index 94a0a6c..3787894 100755
> --- a/configure
> +++ b/configure
> @@ -4519,6 +4519,7 @@ fi
>  
>  add_cppflags -D_ISOC99_SOURCE
>  add_cxxflags -D__STDC_CONSTANT_MACROS
> +add_cxxflags -std=c++11

Is the c++ code in our tree actually c++11? Or just standard c++98? The -std=c++11
option is relatively recent. Very old compilers may not recognize it.

If it is, then you should check if it's supported using check_cxxflags(), then try the
same with c++0x (the original value for the standard back when it was planned to
be finished in the last decade, and a compatibility alias for c++11 on newer
compilers). If neither work then configure should abort.

If it's not, then change it to use c++98.

>  check_cflags -std=c99
>  check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
>  #include <stdlib.h>
>



More information about the ffmpeg-devel mailing list