Building Windows Avidemux V2.6 By Cross Compiling.

Started by AQUAR, December 29, 2014, 11:41:03 AM

Previous topic - Next topic

AQUAR

This is the 3rd (and last from me!) recent thread on building Avidemux from source.
I hope to glean information from each of these approaches to help with problem resolution in the others.

As before - this will be from a totally green perspective, so will be low in techno babble and full of setup mistakes.
Particularly as I am a Windows user and pretty much a stranger to Linux.

At this point I haven't fully comprehended the "put your configuration here" section of the bootStrapCrossMingw_w64 shell script.
From the content in this section it probably should be obvious to a developer familiar with linux (thats not me!).
Nevertheless Core libraries are being build in the install folder (in an to me obscure location that required sudo perrmission for writing).
The build process stops part way in the QT (probably missing some mingw QT4 item!).

If anyone can shed some wisdom on what the export items in the bootstrap configuration section are intended for, that would help.   


AQUAR

Below is the CLI (terminal!) output section when make fails to build ADM_render6_qt4.
My thought is that a module is missing or not build before it is needed by ADM_render6_qt4.
I wonder if the cross compile is slightly broken after the X265 mods (hence no nightly update!).
Hopefully Mean or KoolAidMan can provide some insight.

[ 26%] Building C object commonQt4/ADM_requant/CMakeFiles/ADM_requant6.dir/tcrequant.c.obj
cd /home/john/avidemux2/buildMingwQt4/commonQt4/ADM_requant && /usr/bin/x86_64-w64-mingw32-gcc  -DADM_UI_TYPE_BUILD=ADM_UI_QT4 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -

fpermissive -fmessage-length=0 -O3 -DNDEBUG @CMakeFiles/ADM_requant6.dir/includes_C.rsp   -Werror=attributes -o CMakeFiles/ADM_requant6.dir/tcrequant.c.obj   -c

/home/john/avidemux2/avidemux/common/ADM_requant/tcrequant.c
cc1: warning: command line option '-fpermissive' is valid for C++/ObjC++ but not for C
/home/john/avidemux2/avidemux/common/ADM_requant/tcrequant.c:14:0: warning: "NDEBUG" redefined
#define NDEBUG // turns off asserts
^
<command-line>:0:0: note: this is the location of the previous definition
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libQtOpenGL4.a(qglshaderprogram.o):(.text+0x3280): undefined reference to `__imp_glGetIntegerv'
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libQtOpenGL4.a(qgl.o):(.text+0x565): undefined reference to `__imp_glVertexPointer'
.
. #lots of undefined references in between here#
.
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libQtOpenGL4.a(qgl.o):(.text+0xb704): undefined reference to `__imp_glReadPixels'
/usr/lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/bin/ld: /usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libQtOpenGL4.a(qgl.o): bad reloc address 0x0 in section `.data'
collect2: error: ld returned 1 exit status
commonQt4/ADM_render/CMakeFiles/ADM_render6_qt4.dir/build.make:251: recipe for target 'commonQt4/ADM_render/libADM_render6_qt4.dll' failed
make[2]: *** [commonQt4/ADM_render/libADM_render6_qt4.dll] Error 1

Jan Gruuthuse

#2
Are you using User Interface: Qt (4.8.6)?
Some more info http://qt-project.org/doc/qt-4.8/install-win.html

AQUAR

#3
I am using the fedora repository packages for the mingw cross compiler / windows libraries / source codes.
All of the needed avidemux dependencies seem to be available for the mingw toolchain /cross compile environment.
The "mingw/windows" QT version is 4.8.6.3 (its a separate download!) and its components are all in the PATH.

The flow of the mingw cross compiler build environment on linux I don't understand very well (yet!).
Since I am stuck I will explore the Cmake files and CLI output for clues.

With Mingw/Mys on windows I can build a minimal windows ADM (and the info you point to below applies!).
Not tried beyond that point as I wanted to concentrate a bit on the "Linux" approach.







Jan Gruuthuse

this is what is currently used on ubuntu 14.04.1 LTS
libqt4-dev              4:4.8.5+git192-g

AQUAR

#5
Those QT packages of course are required when building a linux version of ADM on the Linux OS.

For cross compiling, I am thinking that maybe you also need the various windows versions of QT libraries (hence the mingw/QT versions)??
But I am not sure at all just how QT is used here:
. presumeably native QT is/can be set up to suit the cross compile target (something to do with ABI).
. resultant object files and linking to windows QT libraries (or linux QT libraries via ABI?).
. I am just assuming that the bootStrapCrossMingw_w64 shell script does the setting up.

I think (read somewhere!) that Mean uses MXE to build the various windows versions of ADM dependencies for use in the cross compile environment.

Maybe I should check if native QT is the same version as MingwQT and make sure libqt4-dev  4:4.8.5+git192-g is installed (but I have no problem building ADM for Linux!).

Also its probably better if I move Mingw out of the usr directory (seems confusing to have native compilers mixed in with cross compilers).

Pity I need to look at / learn about so many tangents! 



AQUAR

#6
After trying to digest various pages on the QT website:

It seems that various QT constructs (QT Object Subclasses) in the C++ code are preprocessed by the QT MOC (Meta Object Compiler).
Cmake V4.8.6 and up can use "auto MOC" but looking throught the various cmakelists it seems ADM uses a macro to invoke the MOC.

The MOC, as I understand it, replaces the QT Objects with C++ code. So that action would be platform independent.
If true then the cross compile build root would/could use the "Linux QT" MOC and the resultant C++ code then gets looked at by the C++ cross compiler. 

I presume that the MingGW QT static libraries are then needed during linking phase (for building the working windows ADM).

Hopefully I am getting a little bit closer to the inner workings of how to build Windows ADM on Linux.

Hasn't helped me with the make error problem though, except I'll try with the bootstrap script set to point to QT home = Linux QT instead of Mingw QT. 
(update - that didn't work - as make errors out with a "failed to make target" - by looking in the wrong folder for a QT static library).



 

AQUAR

#7
At this point I should probably wait until Mean resumes building nightly versions of windows ADM.
That way I can be sure the build environment is solid and issues like the above relate to my effort.

Meanwhile I'll look at MXE and see if I can do the right thing by compiling everything from a common baseline.
One thought for the undefined references issue is that some run time libraries may have different compiler versions.

mean

I've setup cross compiled x265 + restarted the bot
Seems to work

AQUAR

Thanks Mean,

I'll clone the latest and start again.

Hoping if I build everything using MXE then some of these issues will resolve themselves.