[FFmpeg-devel] compile error for few days

Geek.Song ffmpeg at gmail.com
Sun Jul 1 09:38:42 CEST 2012


On Sun, Jul 1, 2012 at 1:52 PM, Masaru Nomiya <nomiya at galaxy.dti.ne.jp> wrote:
> Hello,
>
> I always get the very latest git of ffmpeg.
> But I can't compile it with the error messase;
>
> [...]
> cc1plus: warning: command line option '-std=c99' is valid for C/ObjC but not for C++ [enabled by default]
> libavcodec/libutvideodec.cpp:56:18: warning: multi-character character constant [-Wmultichar]
> libavcodec/libutvideodec.cpp:60:18: warning: multi-character character constant [-Wmultichar]
> In file included from ./libavutil/libm.h:30:0,
>                  from ./libavutil/internal.h:182,
>                  from ./libavutil/common.h:355,
>                  from ./libavutil/avutil.h:305,
>                  from ./libavutil/samplefmt.h:22,
>                  from libavcodec/avcodec.h:30,
>                  from libavcodec/libutvideodec.cpp:28:
> ./libavutil/intfloat.h: In function 'float av_int2float(uint32_t)':
> ./libavutil/intfloat.h:42:31: error: expected primary-expression before '.' token
> ./libavutil/intfloat.h: In function 'uint32_t av_float2int(float)':
> ./libavutil/intfloat.h:51:31: error: expected primary-expression before '.' token
> ./libavutil/intfloat.h: In function 'double av_int2double(uint64_t)':
> ./libavutil/intfloat.h:60:31: error: expected primary-expression before '.' token
> ./libavutil/intfloat.h: In function 'uint64_t av_double2int(double)':
> ./libavutil/intfloat.h:69:31: error: expected primary-expression before '.' token
> make: *** [libavcodec/libutvideodec.o] error 1
>
>

try this patch:

Index: intfloat.h
===================================================================
--- intfloat.h	(revision 3492)
+++ intfloat.h	(revision 3856)
@@ -39,7 +39,12 @@
  */
 static av_always_inline float av_int2float(uint32_t i)
 {
+#ifdef __cplusplus
+    union av_intfloat32 v;
+    v.i = i;
+#else
     union av_intfloat32 v = { .i = i };
+#endif
     return v.f;
 }

@@ -48,7 +53,12 @@
  */
 static av_always_inline uint32_t av_float2int(float f)
 {
+#ifdef __cplusplus
+    union av_intfloat32 v;
+    v.f = f;
+#else
     union av_intfloat32 v = { .f = f };
+#endif
     return v.i;
 }

@@ -57,7 +67,12 @@
  */
 static av_always_inline double av_int2double(uint64_t i)
 {
+#ifdef __cplusplus
+    union av_intfloat64 v;
+    v.i = i;
+#else
     union av_intfloat64 v = { .i = i };
+#endif
     return v.f;
 }

@@ -66,7 +81,12 @@
  */
 static av_always_inline uint64_t av_double2int(double f)
 {
+#ifdef __cplusplus
+    union av_intfloat64 v;
+    v.f = f;
+#else
     union av_intfloat64 v = { .f = f };
+#endif
     return v.i;
 }


-- 
-----------------------------------------------------------------------------------------
My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2


More information about the ffmpeg-devel mailing list