Main Menu

Windows build instructions

Started by madact, February 22, 2012, 02:52:26 PM

Previous topic - Next topic


I'd like to do a bit of tweaking to avidemux for my own personal use - and subsequent patch submission (the issue with the displayed colourspace being wrong and causing (among other things) a distinct yellow -> green colour shift in the GUI under windows / QT, in particular - unless someone has fixed this already? last looked a few months back...). I'd also like to do some plugin development. However, the windows build instructions on the wiki ( are hopelessly outdated, referring to version 2.3 and GTK only, and I can't find any more recent doco.

There are windows binaries for 2.5 available, presumably they don't build themselves, so someone or something must know what the prerequisites and build steps are...

The other point of confusion is which branch to develop for - should I submit for 2.5 (seeing as I want to do "real stuff" with the result) and let the main devs port patches to 2.6, or vice-versa, or submit for both, or what exactly?



P.S. looking at the SourceForge and berliOS pages for avidemux, they list only linux / BSD and linux / BSD / Mac respectively... and X11 as the GUI. This also seems a little out of date...


If you do it with 2.6 i can help a bit.
If you want to write your own plugins, you should not need to rebuild everything


Thanks, that would be great. The videos I'm most needing to do colour correction on are in Panasonic AVCHD format, I don't really mind what they come out as :oP so if 2.6 can handle it, that will be me sorted.

The thing that was holding me up was incorrect colour display in the QT GUI, which is why I want to actually dig into the source code. The plugin side of the equation is W.R.T. adding some colourspace conversion / correction and (maybe!) a plugin to parse deshaker files and do the render pass - of course it doesn't hurt to have a consistent build environment.

Mainly I need to know what versions of MinGW and/or Cygwin, Qt SDK, and other required libraries I need, and what the 'canonical' build procedure is  - I'm a programmer by trade, so I can handle the details, just prefer not to have to dig through the build scripts & do test compiles to figure out the correct versions.



The simplest is to use mingw
and install the relevant packages

Mainly Qt4 (4.8.0 for example), cmake, zlib, and libpng for the minium part

Make sure your path has access to all this and
mkdir obj && cd obj && cmake ..
should take care of most of the things

Make sure you provide a CMAKE_INSTALL_PREFIX ("c:/foobar")
and dont forget make install after each step

The order is
* core
* avidemux_qt4
* plugins
* plugins_qt4


So far so good - managed to make cmake to like me, which was a bit more involved than anticipated, but now I have this issue:

$ make
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -H/C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core -B/C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj --check-build-system CMakeFiles/Makefile.cmake 0
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_start /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/CMakeFiles /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
make -f ADM_core/src/CMakeFiles/ADM_core6.dir/build.make ADM_core/src/CMakeFiles/ADM_core6.dir/depend
make[2]: Entering directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_depends "MSYS Makefiles" /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/ADM_core/src /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/ADM_core/src /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/ADM_core/src/CMakeFiles/ADM_core6.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
make -f ADM_core/src/CMakeFiles/ADM_core6.dir/build.make ADM_core/src/CMakeFiles/ADM_core6.dir/build
make[2]: Entering directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_report /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/CMakeFiles 7
[  1%] Building CXX object ADM_core/src/CMakeFiles/ADM_core6.dir/ADM_win32.cpp.obj
cd /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj/ADM_core/src && /c/QtSDK/mingw/bin/g++.exe   -DADM_core6_EXPORTS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -fmessage-length=0 -O3 -DNDEBUG @CMakeFiles/ADM_core6.dir/includes_CXX.rsp    -IC:/MinGW/include -o CMakeFiles/ADM_core6.dir/ADM_win32.cpp.obj -c /C/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/ADM_core/src/ADM_win32.cpp
c:/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/ADM_core/src/ADM_win32.cpp: In function 'int shutdown_win32()':
c:/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/ADM_core/src/ADM_win32.cpp:150: error: 'SHTDN_REASON_FLAG_PLANNED' was not declared in this scope
make[2]: *** [ADM_core/src/CMakeFiles/ADM_core6.dir/ADM_win32.cpp.obj] Error 1
make[2]: Leaving directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
make[1]: *** [ADM_core/src/CMakeFiles/ADM_core6.dir/all] Error 2
make[1]: Leaving directory `/c/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/obj'
make: *** [all] Error 2

Same deal whether I use the mingw which comes with Qt or standalone mingw - looks like it's missing a windows API include, but I'm not not sure if going and including that would be a good idea...

*Note: I am doing this on the head revision of avidemux_2.6_branch_mean, maybe there's a better tag / revision for me to be syncing to?


You could try
#define SHTDN_REASON_FLAG_PLANNED 0x80000000 and see if that is the only "not declared in this scope" error.
I am away between 15th of May - 15th of June. (yes, I am playing D3)


Thanks - that fixes that error, but only gets me so far - a few files later I get

C:/Users/a/work/avidemux_2.6_branch_mean/avidemux_core/ADM_core/src/ADM_crashdump_mswin.cpp:277:1: error: 'EXCEPTION_DISPOSITION' does not name a type

... which apparently ( should be in winnt.h, and which has a much more involved definition, including various other declared types as members :-/

I'm guessing this is to do with incomplete windows API coverage in MinGW? Which set of windows includes are being to build the binaries which are being distributed?


What flavour of mingw are you using?  If you're using MinGW (, you may be missing the w32api package that is available from the same site.  If you're using mingw-w64 ( then make sure you're using the latest runtime (2.0.1).

mingw-w64 is the flavour I use.  I think Mean does too.



Apparently I already have w32api

$ mingw-get.exe install mingw32-w32api           
install: w32api-3.17-2-mingw32-dev.tar.lzma
installing w32api-3.17-2-mingw32-dev.tar.lzma
mingw-get.exe: *** ERROR *** package w32api-3.17-2-mingw32-dev.tar.lzma is already installed

... but I went grepping, and the definition turns out to be in excpt.h, which wasn't included.

I also needed to #define __STDC_CONSTANT_MACROS to get the ffmpeg includes to work properly in numerous places (chucked it in ADM_default.h, all good), and avidemux_core/ADM_coreUtils/src/infoExtractorH264.cpp was using alloca without including malloc.h (maybe on linux alloca.h was slipping in by some other route?).

So, I have 'core' compiling OK now...

Next issue is avidemux/qt4 ... looks like I need to install GLEW to get all the openGL stuff to compile - will let you know if I have troubles getting that bit up and running.


OK, with a bit of glew and another excpt.h include I seem to have a working frontend. Couldn't find a qt4 subdirectory to the plugins directory, mind you... is that still correct?

I've attached my butchery as a diff to the 2.6 branch - these changes make the compiler stop complaining, but there may be better places to put them...

Still have to get the files I want to process off anoother PC, but I can't actually load any of the video files I happen to have lying around on this computer - not x264 as far as I know, but how limited is the current file support in 2.6, anyhow?



OK, had some more time to try and get this working today. Tried a fresh install of mingw64, using the latest autobuild from here:
and the MSYS located nearby. There was nothing labeled "2.0.1" (?)...

Cmake took a little bit of prompting to find the compilers, kept asking where "windres.exe" was, and even when I got it to finally accept everything by the rather extreme use of

cmake -G "MSYS Makefiles" -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres -DCMAKE_INSTALL_PREFIX:PATH=/c/build -DPTHREAD_INCLUDE_DIR=/include/ -DZLIB_INCLUDE_DIR=/include ..

... which still doesn't do much good, as cmake then seems to presumes that because I've specified compilers, it can ignore the "MSYS Makefiles" part and look for NMake anyway, when I type "make" (and then complains about not being able to find cl - and this with "# Generated by "MSYS Makefiles" Generator, CMake Version 2.8" clear as day at the top of the make file  >:( )

Oh yes, and no matter which g++ / gcc cmake says it's using, it always spits out
-- Checking for pthreads
-- *********************
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no

which wasn't a problem with regular mingw.

I must confess, I'm a little stumped. Any chance I could get a more specific list of required mingw64 and msys installers? The mingw64 project on SF in particular has directories, snapshot variants and personal builds coming out of more orifices than I care to mention :-\


I build my own multilib compiler with the latest stable GCC and mingw-w64 runtime but the automated mingw-w64 builds should be ok for dev use.  GCC 4.6.2 or higher should be ok for Windows builds.  I'd rename the exe files though so the prefix (x86_64-w64-mingw32) is stripped off.

My build scripts may help.  They're bundled with the source code (2.5 & 2.6).  The 2.5 scripts rely on MSYS's bash shell whereas 2.6 is pretty much straight MinGW (for Code::Blocks compatibility).