Page 1 of 1

Where is QtWidgets/QAction ?

Posted: 16 Jul 2015 05:17
by DrHobo
Hello.

I'm following the wiki to compile VLC to cross-compile libVLC to Windows: https://wiki.videolan.org/Win32Compile/#Building_VLC
Using Ubuntu 14.10 to compile for 64-bits Windows (x86_64-w64-mingw32).

The wiki specifies that we install qt4-dev-tools and qt5-default.

However, compiling stops at this error:

Code: Select all

make[5]: Entering directory '/home/narc/vlc/win32/modules/gui/qt4' CXX libqt4_plugin_la-qt4.lo In file included from ../../../../extras/package/win32/../../../modules/gui/qt4/dialogs/open.hpp:35:0, from ../../../../extras/package/win32/../../../modules/gui/qt4/dialogs_provider.hpp:36, from ../../../../extras/package/win32/../../../modules/gui/qt4/qt4.cpp:38: ./ui/open.h:14:29: fatal error: QtWidgets/QAction: No such file or directory #include <QtWidgets/QAction> ^ compilation terminated.
When I look at my Qt include files in /usr/include/qt4, all I see is this:

Code: Select all

drwxr-xr-x 21 root root 4096 Jul 15 15:27 . drwxr-xr-x 49 root root 16384 Jul 15 16:52 .. drwxr-xr-x 2 root root 36864 Jul 15 15:27 Qt drwxr-xr-x 2 root root 16384 Jul 15 15:27 Qt3Support drwxr-xr-x 2 root root 24576 Jul 15 15:27 QtCore drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtDBus drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtDeclarative drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtDesigner drwxr-xr-x 2 root root 40960 Jul 15 15:27 QtGui drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtHelp drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtNetwork drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtOpenGL drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtScript drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtScriptTools drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtSql drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtSvg drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtTest drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtUiTools drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtWebKit drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtXml drwxr-xr-x 2 root root 4096 Jul 15 15:27 QtXmlPatterns
Many forums specialized in Qt talk about adding Qt += widgets in some *.pro file with Qt 5. But I don't think the wiki expected a full Qt 5 environment to be installed (and besides, qt5-default is a small package of a few files : http://packages.ubuntu.com/utopic/amd64 ... t/filelist) and the only *.pro file available is in the doc directory:

Code: Select all

find | grep "\.pro" ./modules/stream_out/chromecast/cast_channel.proto ./doc/libvlc/QtPlayer/QtVLC.pro
So what would be the necessary steps to complete this compilation ?

Regards.

Re: Where is QtWidgets/QAction ?

Posted: 16 Jul 2015 10:40
by Jean-Baptiste Kempf
Use update-alternatives to have uic set to qt4, and not qt5

Re: Where is QtWidgets/QAction ?

Posted: 16 Jul 2015 18:51
by DrHobo
Thanks Jean-Baptiste.

Simply changing the qt version wasn't enough (or the changing operation failed, somewhat) and it kept me giving the same error.

I always deleted the moc, uic and rcc files in the contrib/x86_64-w64-mingw32/bin, but this time I kept them assuming that the warning in the wiki entitled Linux 64-bit was for compiling a 32-bit version (since the alternative was to install ia32-libs, etc) and hoping they would be compatible with my build. It may not be the best solution, but at least I got it compiled.

So if anybody else is reading this, proceed with caution. :)

Re: Where is QtWidgets/QAction ?

Posted: 27 Feb 2016 16:54
by profootball
Hi DrHobo,

may I ask what is your final solution?
keep those moc files?

thanks.

Re: Where is QtWidgets/QAction ?

Posted: 19 Dec 2016 17:17
by stavrosg
I am having this issue aswell. Whats is being refereed to by update-alternatives?

Stav

Re: Where is QtWidgets/QAction ?

Posted: 19 Dec 2016 19:37
by RĂ©mi Denis-Courmont
It's a Debian tool to select between, well, alternatives. See manual pages or Debian documentation.

Re: Where is QtWidgets/QAction ?

Posted: 19 Dec 2016 20:15
by stavrosg
Thanks Remi,

Got it working, my work flow;

git config --system core.autocrlf false
git clone git://git.videolan.org/vlc/vlc-2.2.git vlc
cd vlc
mkdir -p contrib/win32 && cd contrib/win32
../bootstrap --host=i686-w64-mingw32
make prebuilt
rm -f ../i686-w64-mingw32/bin/moc ../i686-w64-mingw32/bin/uic ../i686-w64-mingw32/bin/rcc
cd -
./bootstrap
mkdir win32 && cd win32
export PKG_CONFIG_LIBDIR=/samba/vlc/contrib/i686-w64-mingw32/lib/pkgconfig
../extras/package/win32/configure.sh --host=i686-w64-mingw32 --build=x86_64-pc-linux-gnu
*NOTE, not sure it did anything* added "QT += widgets" to vlc/doc/libvlc/QtPlayer/QtVLC.pro
make clean <- extra step, found on wireshark forums
make
make package-win-common

BTW love the app, use it tons. Excellent work and thanks!!

Cheers
Stav

Re: Where is QtWidgets/QAction ?

Posted: 23 Feb 2017 17:41
by ryantheseer
I tried building for Windows 64-bit from the 2.2.4 tag in vlc-2.2.git from Linux (Ubuntu 64-bit 16.04). I followed these steps after setting up the toolchain, from a folder named ~/dev/ on the Linux machine:

Code: Select all

git clone git://git.videolan.org/git/vlc-2.2.git vlc cd vlc mkdir -p contrib/win32 cd contrib/win32 ../bootstrap --host=x86_64-w64-mingw32 make prebuilt
(Skipped the Linux 64-bit removals step)

Code: Select all

ln -sf 'x86_64-w64-mingw32' ../i686-w64-mingw32 cd ../ ls -l cd ../ ./bootstrap mkdir win32 && cd win32 export PKG_CONFIG_LIBDIR=$HOME/dev/vlc/contrib/x86_64-w64-mingw32/lib/pkgconfig ../configure --host=x86_64-w64-mingw32 --build=x86_64-pc-linux-gnu make