After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576018 - [filesrc] compile error with mingw: storage size of 'stat_results' isn't known
[filesrc] compile error with mingw: storage size of 'stat_results' isn't known
Status: RESOLVED DUPLICATE of bug 568632
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.22
Other Windows
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-19 23:07 UTC by Levente Farkas
Modified: 2009-04-16 23:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Levente Farkas 2009-03-19 23:07:44 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
----------------------------------------
Comment 1 Tim-Philipp Müller 2009-04-16 01:39:00 UTC
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?
Comment 2 Tim-Philipp Müller 2009-04-16 08:13:31 UTC
> 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).
Comment 3 Levente Farkas 2009-04-16 11:56:05 UTC
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).
Comment 4 Tim-Philipp Müller 2009-04-16 23:00:31 UTC
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 ***