CLI Compile error under minGW

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

CLI Compile error under minGW

Post by Shatian »

I have been compiling the CLI under ubuntu minGW for a little while now, until I updated past rev 3266. 3266 compiles fine, but 3267, which updates ffmpeg, and a few other things,fails to compile. I know it's been a little while since this was patched, but I don't compile every night.

Here's the error log:

: /usr/bin/make -C ./contrib/ffmpeg/ffmpeg-r22950/
: make[1]: Entering directory `/home/ed/HandBrake/build/contrib/ffmpeg/ffmpeg-r22950'
: CC libavdevice/alldevices.o
: In file included from ./libavformat/avformat.h:55,
: from libavdevice/alldevices.c:22:
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/stdio.h:372: error: no previous prototype for ‘getc’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/stdio.h:379: error: no previous prototype for ‘putc’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/stdio.h:386: error: no previous prototype for ‘getchar’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/stdio.h:393: error: no previous prototype for ‘putchar’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/stdio.h:606: error: no previous prototype for ‘vsnwprintf’
: In file included from ./libavutil/common.h:31,
: from ./libavutil/avutil.h:81,
: from ./libavcodec/avcodec.h:30,
: from ./libavformat/avformat.h:56,
: from libavdevice/alldevices.c:22:
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/inttypes.h:259: error: no previous prototype for ‘imaxabs’
: In file included from ./libavutil/common.h:33,
: from ./libavutil/avutil.h:81,
: from ./libavcodec/avcodec.h:30,
: from ./libavformat/avformat.h:56,
: from libavdevice/alldevices.c:22:
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:357: error: no previous prototype for ‘__fpclassifyl’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:378: error: no previous prototype for ‘__isnan’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:387: error: no previous prototype for ‘__isnanf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:396: error: no previous prototype for ‘__isnanl’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:413: error: no previous prototype for ‘__signbit’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:419: error: no previous prototype for ‘__signbitf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:425: error: no previous prototype for ‘__signbitl’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:459: error: no previous prototype for ‘sinhf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:463: error: no previous prototype for ‘coshf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:467: error: no previous prototype for ‘tanhf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:489: error: no previous prototype for ‘expf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:505: error: no previous prototype for ‘frexpf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:517: error: no previous prototype for ‘ldexpf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:597: error: no previous prototype for ‘hypotf’
: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/math.h:602: error: no previous prototype for ‘powf’
: make[1]: *** [libavdevice/alldevices.o] Error 1
: make[1]: Leaving directory `/home/ed/HandBrake/build

Any idea why this is failing?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: CLI Compile error under minGW

Post by s55 »

in the build dir

make ffmpeg.xclean
make
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

Re: CLI Compile error under minGW

Post by Shatian »

Same results. I remove the build directory before I run configure...
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: CLI Compile error under minGW

Post by s55 »

Probably dying for the same reason the nightly is. Someone will fix it when they have time to get around to it
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

Re: CLI Compile error under minGW

Post by Shatian »

Ok. Thanks.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: CLI Compile error under minGW

Post by JohnAStebbins »

I tested building mingw before the last ffmpeg bump was committed. It worked then. So I just did a make xclean; make. Works now as well. So I thought, maybe I should replicate your steps completely and remove the build directory. Still works. Don't know what else to try. I use fedora which has a more complete mingw set of packages.
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

Re: CLI Compile error under minGW

Post by Shatian »

Oddly enough, I could never get it to compile under fedora, always failed then too. I installed ubuntu, worked ok until yesterday when I updated to the newest revision. This morning I did a svn up -r 3266 HandBrake, then a rm -r -f build, then ./configure --cross=i586-mingw32msvc --launch. Compile successfully. I then did svn up -r 3267 HandBrake, then a rm -r -f build, then ./configure --cross=i586-mingw32msvc --launch. And got the error message above. Just tried it again to make sure, same result. I'm at a loss too.
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

Re: CLI Compile error under minGW

Post by Shatian »

Found the problem, in case anyone is interested. ffmpeg added check_cflags -Werror=missing-prototypes to configure, and the version of mingw32 that comes with ubuntu (4.2) doesn't like that. The version that comes with fedora is newer (4.4). I still can't get it to compile on fedora though, bombs out when it tries to create hb.lib with a lot of undefined references in libdvdread.a and libx264.a.

Thanks for looking into this for me though.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: CLI Compile error under minGW

Post by JohnAStebbins »

Yes, fedora's *complete* mingw distribution does a little more than you want. For starters, it installs wine and enables automatic execution of windows executables. This breaks many configure scripts that attempt to run an exe that they build in order to determine if you are cross compiling or not. So configure guesses wrong and ends up building with incorrect options. So you need to open System->Administration->Services and disable wine and make sure it doesn't run it the next time you boot.

In addition, our build system builds a local copy of pthreads that conflicts with the pthreads lib fedora installs. So you need to uninstall mingw's pthreads lib.

And finally, libdl (dlopen and friends) doesn't work properly with the way we configure libdvdread. So you need to uninstall mingw's libdl.
Shatian
Posts: 17
Joined: Wed Nov 11, 2009 12:31 am

Re: CLI Compile error under minGW

Post by Shatian »

Excellent, that did the trick, thanks!
NaVVy
Posts: 18
Joined: Tue Jul 29, 2008 10:48 am

Re: CLI Compile error under minGW

Post by NaVVy »

Hi guys!

I was having the same issue compiling under Ubuntu (clean install this week) and noticed that if I installed the mingw32 packages i get

Code: Select all

/usr/bin/i586-mingw32msvc-gcc --version
i586-mingw32msvc-gcc (GCC) 4.2.1-sjlj (mingw32-2)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But there is another package called gcc-mingw32 which gives you

Code: Select all

/usr/bin/i586-mingw32msvc-gcc --version
i586-mingw32msvc-gcc (GCC) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
It seems a little strange to get two different versions of the same software in a repo, but the newer version works for me at compiling the latest build.

Hope this helps others. :D
RogerDahl
Posts: 2
Joined: Sun May 23, 2010 6:41 pm

Re: CLI Compile error under minGW

Post by RogerDahl »

Thank you, NaVVy, that did the trick for me as well (Ubuntu 10.04 LTS).

Code: Select all

$ sudo apt-get remove mingw32
$ sudo apt-get install gcc-mingw32
$ ./configure --cross=i586-mingw32msvc --launch-jobs=1 --launch --force
Roger
Post Reply