[FFmpeg-devel] libm.h cross complier errors

kl222 kl222 at 126.com
Mon Oct 7 06:02:36 CEST 2013


Hello all:

In cygwin using mingw cross compiler errors.

 

Enviorment:

Cygwin 1.7.25-1

Cross complier:

$ i686-pc-mingw32-gcc -v

Using built-in specs.

COLLECT_GCC=i686-pc-mingw32-gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-mingw32/4.7.3/lto-wrapper.exe

Target: i686-pc-mingw32

Configured with:
/usr/src/packages/mingw-gcc/32/mingw-gcc-4.7.3-1/src/gcc-4.7.3/configure
--srcdir=/usr/src/packages/mingw-gcc/32/mingw-gcc-4.7.3-1/src/gcc-4.7.3
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var
--sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/mingw-gcc
-C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-mingw32
--without-libiconv-prefix --without-libintl-prefix
--with-sysroot=/usr/i686-pc-mingw32/sys-root
--with-build-sysroot=/usr/i686-pc-mingw32/sys-root
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
--enable-libstdcxx-debug --disable-build-poststage1-with-cxx
--enable-version-specific-runtime-libs --disable-multilib
--enable-decimal-float=bid --disable-werror --enable-lto

Thread model: win32

gcc version 4.7.3 (GCC)

 

Run:

$./configure --enable-cross-compile --target-os=mingw32 --arch=i686
--cross-prefix=i686-pc-mingw32-
--sysroot=/cygdrive/c/cygwin/usr/i686-pc-mingw32/sys-root --enable-static
--prefix=/usr/local/mingw --enable-swscale --enable-postproc
--enable-libx264 --enable-gpl --extra-ldflags=-L/usr/local/mingw/lib
--extra-cflags=-I/usr/local/mingw/include

$ make V=1

touch .version

i686-pc-mingw32-gcc -I. -I./
--sysroot=/cygdrive/c/cygwin/usr/i686-pc-mingw32/sys-root -D_ISOC99_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__
-D__USE_MINGW_ANSI_STDIO=1 -DHAVE_AV_CONFIG_H -I/usr/local/mingw/include
-std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall
-Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings
-Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast
-Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros
-fno-tree-vectorize -Werror=implicit-function-declaration
-Werror=missing-prototypes -Werror=return-type -Werror=vla  -MMD -MF
libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o
libavdevice/alldevices.o libavdevice/alldevices.c

In file included from ./libavutil/internal.h:135:0,

                 from ./libavutil/common.h:410,

                 from ./libavutil/avutil.h:277,

                 from libavdevice/version.h:28,

                 from libavdevice/avdevice.h:22,

                 from libavdevice/alldevices.c:22:

./libavutil/libm.h:59:31: error: static declaration of 'cbrtf' follows
non-static declaration

./libavutil/libm.h:86:38: error: expected identifier or '(' before 'sizeof'

./libavutil/libm.h:86:38: error: expected ')' before '==' token

./libavutil/libm.h:96:38: error: expected identifier or '(' before 'sizeof'

./libavutil/libm.h:169:40: error: static declaration of 'roundf' follows
non-static declaration

./libavutil/libm.h:183:40: error: static declaration of 'truncf' follows
non-static declaration

common.mak:48: recipe for target `libavdevice/alldevices.o' failed

make: *** [libavdevice/alldevices.o] Error 1

 

 

In config.log:

check_mathfunc cbrtf 1

check_ld cc

check_cc

BEGIN /tmp/ffconf.wGJz4UCj.c

    1   #include <math.h>

    2   float foo(float f, float g) { return cbrtf(f); }

    3   int main(void){ return (int) foo; }

END /tmp/ffconf.wGJz4UCj.c

i686-pc-mingw32-gcc
--sysroot=/cygdrive/c/cygwin/usr/i686-pc-mingw32/sys-root -D_ISOC99_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__
-D__USE_MINGW_ANSI_STDIO=1 -I/usr/local/mingw/include -std=c99
-fomit-frame-pointer -c -o /tmp/ffconf.mbHLoiuI.o /tmp/ffconf.wGJz4UCj.c

i686-pc-mingw32-gcc -L/usr/local/mingw/lib
--sysroot=/cygdrive/c/cygwin/usr/i686-pc-mingw32/sys-root -Wl,--nxcompat
-Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.vR6AhhPg.exe
/tmp/ffconf.mbHLoiuI.o -lm -lbz2 -lz -lpsapi -ladvapi32 -lshell32

/cygdrive/c/cygwin/usr/i686-pc-mingw32/sys-root/mingw/lib/libmingwex.a(cbrtf
.o): In function `cbrtf':

/usr/src/debug/mingw-runtime-4.0-1/misc/src/libcrt/math/cbrtf.c:81:
undefined reference to `__fpclassifyf'

collect2: error: ld returned 1 exit status

 

 

 

The reason is libm library have defined "cbrtf", but it depends on the
function is not implemented. Therefore, a conflict the two definitions, and
undefined c99 solution to the conflict. 

In line 86 error, I don't find the error.

How can we solve?

 



More information about the ffmpeg-devel mailing list