GNOME Bugzilla – Bug 576018
[filesrc] compile error with mingw: storage size of 'stat_results' isn't known
Last modified: 2009-04-16 23:00:31 UTC
hi, while we try to compile gstreamer on fedora with mingw we got and error ---------------------------------------- error: storage size of 'stat_results' isn't known ---------------------------------------- and the reason is that because __stat64 is defined in /usr/i686-pc-mingw32/sys-root/mingw/include/sys/stat.h but only as : ---------------------------------------- #if __MSVCRT_VERSION__ >= 0x0601 struct __stat64 { _dev_t st_dev; _ino_t st_ino; _mode_t st_mode; short st_nlink; short st_uid; short st_gid; _dev_t st_rdev; __int64 st_size; __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; }; #endif /* __MSVCRT_VERSION__ */ ---------------------------------------- and at the same time in by default in /usr/i686-pc-mingw32/sys-root/mingw/include/_mingw.h : ---------------------------------------- #ifndef __MSVCRT_VERSION__ /* High byte is the major version, low byte is the minor. */ # define __MSVCRT_VERSION__ 0x0600 #endif ---------------------------------------- this means mingw do not contain any 64 bit version stat by default. ok i can build with: make CFLAGS="$CFLAGS -D__MSVCRT_VERSION__=0x0601" but imho it's a bug in gstreamer. ie. it should have to add to the default gcc argument the above if it's configured for mingw. i don't know where whould be the best place to add it configure or libtool or... but would be useful to add if someone like to compile with mingw for windows. yours. anyway the full error log is: ---------------------------------------- libtool: compile: i686-pc-mingw32-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/i686-pc-mingw32/sys-root/mingw/include -I../../libs -I../.. -I../.. -mms-bitfields -I/usr/i686-pc-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/i686-pc-mingw32/sys-root/mingw/include/libxml2 -Wall -Wdeclaration-after-statement -Wvla -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -MT libgstcoreelements_la-gstqueue.lo -MD -MP -MF .deps/libgstcoreelements_la-gstqueue.Tpo -c gstqueue.c -DDLL_EXPORT -DPIC -o .libs/libgstcoreelements_la-gstqueue.o gstfilesrc.c: In function 'gst_file_src_get_size': gstfilesrc.c:940: error: storage size of 'stat_results' isn't known gstfilesrc.c:951: warning: implicit declaration of function '_fstat64' gstfilesrc.c:940: warning: unused variable 'stat_results' gstfilesrc.c: In function 'gst_file_src_start': gstfilesrc.c:970: error: storage size of 'stat_results' isn't known gstfilesrc.c:970: warning: unused variable 'stat_results' make[3]: *** [libgstcoreelements_la-gstfilesrc.lo] Error 1 ----------------------------------------
Got any suggestions for a patch that fixes things for you (while keeping things working for everyone else, of course)? Any change with the recent fixes in git?
> Got any suggestions for a patch that fixes things for you (while keeping things > working for everyone else, of course)? By which I meant a patch that doesn't defining passing presumably internal preprocessor symbols in CFLAGS, btw (I find it hard to believer that's the best solution available).
for mingw we use the cflags trick: CFLAGS="$CFLAGS -D__MSVCRT_VERSION__=0x0601" of course those who compile with msvc on a windows machine where msvc knows which version of msvcrt is installed (and anything newer then win98 is ok) it's working automatically since msvc define this variable with the right value. probably add this define to the mingw compile option can be a solution (and the resulting bin not working on win98 which is not working on win98 anyway it compiled by msvc either).
Ok. Marking this as dup of the other one, since the other one has a patch attached and I'm lazy. Thanks for the bug report! *** This bug has been marked as a duplicate of 568632 ***