Problems compiling nightly in Linux for windows

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
stryfewalker
Posts: 18
Joined: Thu Feb 18, 2010 4:26 pm

Problems compiling nightly in Linux for windows

Post by stryfewalker »

Please detail your question or problem in as much detail as possible:
Following the instructions at https://trac.handbrake.fr/wiki/CompileOnWindows I have successfully compiled the nightly handbrakecli.exe and the hb.dll in Ubuntu 14.04 to use on my main Windows system to add back in the FDK audio support. The last time I successfully did this was back in April.

I decided to go ahead and recompile a new nightly but am now running into some errors very early in the process. I am using the standard Ubuntu 14.04 as recommended in the above link. Everything is pretty much vanilla other then running the Ubuntu software updater.

Here is the terminal window information:

Code: Select all

xxxx@xxxxpc2016:~$ x86_64-w64-mingw32-gcc -v
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/home/matt/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --prefix=/home/mingw-w64/mingw-w64/linux-x86_64-x86_64/build/build/root --with-sysroot=/home/mingw-w64/mingw-w64/linux-x86_64-x86_64/build/build/root --with-gnu-ld --with-gnu-as --enable-fully-dynamic-string --disable-multilib
Thread model: win32
gcc version 4.9.0 20131228 (experimental) (GCC) 
xxxx@xxxxpc2016:~$ git clone https://github.com/HandBrake/HandBrake.git
Cloning into 'HandBrake'...
remote: Counting objects: 65448, done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 65448 (delta 13), reused 0 (delta 0), pack-reused 65415
Receiving objects: 100% (65448/65448), 66.59 MiB | 15.47 MiB/s, done.
Resolving deltas: 100% (49260/49260), done.
Checking connectivity... done.
xxxx@xxxxpc2016:~$ cd HandBrake
xxxx@xxxxpc2016:~/HandBrake$ ./configure --cross=x86_64-w64-mingw32 --enable-x265 --enable-qsv --enable-hwd --enable-fdk --launch-jobs=1 --launch
probe: host tuple...(pass) x86_64-unknown-linux-gnu
compute: available architectures...(pass) x86_64
find: ar...(pass) /usr/bin/ar
find: cp...(pass) /bin/cp
find: gcc...(pass) /usr/bin/gcc
find: gmake...(pass) /usr/bin/make
find: gm4...(pass) /usr/bin/m4
find: mkdir...(pass) /bin/mkdir
find: gpatch...(pass) /usr/bin/patch
find: rm...(pass) /bin/rm
find: ranlib...(pass) /usr/bin/ranlib
find: strip...(pass) /usr/bin/strip
find: gtar...(pass) /bin/tar
find: yasm...(pass) /usr/bin/yasm
find: autoconf...(pass) /usr/bin/autoconf
find: automake...(pass) /usr/bin/automake
find: cmake...(pass) /usr/bin/cmake
find: libtool...(pass) /usr/bin/libtool
find: pkg-config...(pass) /usr/bin/pkg-config
find: xcodebuild...(fail) not found
find: lipo...(fail) not found
Usage: configure.py [OPTIONS...] [TARGETS...]

configure.py: error: no such option: --enable-hwd
xxxx@xxxxpc2016:~/HandBrake$ 
Is there something I need to update or customize in the configure.py file or has the compiling options changed since I last successfully compiled? (I'm specifically referring to the --enable-hwd error I got).

Any help would be appreciated.
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Problems compiling nightly in Linux for windows

Post by s55 »

configure.py: error: no such option: --enable-hwd
Remove that option from the configure call
stryfewalker
Posts: 18
Joined: Thu Feb 18, 2010 4:26 pm

Re: Problems compiling nightly in Linux for windows

Post by stryfewalker »

I had tried removing that call about a week ago and it failed. I tried again just now and it failed. However, after consulting the log file I think it might be related to the fix from this thread.
stryfewalker
Posts: 18
Joined: Thu Feb 18, 2010 4:26 pm

Re: Problems compiling nightly in Linux for windows

Post by stryfewalker »

After removing the --enable-hwd call I then had to use the fix from this thread to successfully compile a new hb.dll that could use FDK (this is the soul reason I am doing this).

I was using the mingw-w64 to compile LibHB for Windows as recommended on the CompileOnWindows page:
We use ​MinGW-W64 to compile HandBrakeCLI and LibHB for windows. You will need a copy of their toolchain from ​http://sourceforge.net/projects/mingw-w ... rce=navbar

Please see "Toolchains targetting Win64" -> "Automated Builds" and choose the latest version.

At the time of writing, "mingw-w64-bin_x86_64-linux_20131228.tar.bz2" is used.
This method previously worked with just unzipping the tar file and adding the bin contained within it to the path as the instructions indicated. I successfully compiled a couple different nightly builds back in April with pretty much following the compileonwindows instructions to the letter with the exception of adding the --enable-fdk call on the ./configure line. Sometime between the end of April and late June, besides needing to remove the --enable-hwd call, the compile needed to reference a directory path that was predefined in the libstdc++.la file and had to be manually updated to reflect the correct directory path. I guess before the compile didn't use that reference?

Anyway, I hope this is helpful for other novices (like me) that might have trouble compiling the nightlys... at least until other changes are made. :D
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Problems compiling nightly in Linux for windows

Post by BradleyS »

My comment from the other thread:
BradleyS wrote:You're probably using a prebuilt mingw toolchain, configured with a sysroot that doesn't match its location on your system. Hint: delete all the .la files, or fix the paths in them.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Problems compiling nightly in Linux for windows

Post by BradleyS »

And the subsequent comment:
BradleyS wrote:I should add, if you'd like to build a proper mingw toolchain, try the bash script included with HandBrake's source at scripts/mingw-w64-build. This is what is used as the cross-compilation toolchain for the nightly builds.

Note that there is currently an issue with image previews on Windows that we hope to resolve soon; see https://github.com/HandBrake/HandBrake/issues/246. Video previews work fine.
Post Reply