[SOLVED] Building a Qt Apllication

Started by seasons, 2014/06/17, 09:21:40

Previous topic - Next topic

seasons

I was curious to try out the new Qt interface of Audacious (they just started development of it). However, I cannot get it to locate the headers:

qtui.cc:20:24: fatal error: QApplication: No such file or directory
#include <QApplication>
                        ^
compilation terminated.


I have the file(s) installed:
/usr/include/qt4/QtGui/QApplication
/usr/include/x86_64-linux-gnu/qt5/QtGui/QApplicationStateChangeEvent
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication


Do I need to do something special to make audacious find the Qt headers?

devil

Are they maybe using Qt 5 already?


greetz
devil

seasons

Perhaps, but I have the appropriate qt5 dev packages installed.
I even tried to make a qt5 symlink in /usr/include in the event that the x86_64-linux-gnu subdir was causing the issue.

hefee

To get buiding qt5 applications, you need the following packages installed:
qttools5-dev,qttools5-dev-tools

for qt4:libqt4-dev should be enough

(you can look also at qt4/qt5 applications shipped with debian and look at there build dependencies like scribus(qt4):
https://packages.debian.org/source/sid/scribus
owncloud-client(qt5):
https://packages.debian.org/source/sid/owncloud-client

seasons

I already have all of those packages installed  :-\

hefee

what says qtchooser -l?
Do you know the new port is buildable?

Maybe Audacious shippes his own .cmake files to search for qt -> list all files inside the dir <src dir>/cmake/modules

seasons

It is a Qt5 program, so I even tried installing qt5-default, but still no joy. The funny thing is that the configure program finds the Qt headers okay, but make does not.

# qtchooser -l
4
5
default
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

# ls -la /usr/lib/x86_64-linux-gnu/qtchooser

lrwxrwxrwx  1 root root     50 Jun 16 10:01 4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx  1 root root     50 Jun  7 18:02 5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx  1 root root     50 Jun  7 18:02 default.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx  1 root root     50 Jun 16 10:01 qt4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx  1 root root     50 Jun  7 18:02 qt5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf


I don't think audacious is using cmake. Here is the makefile for their Qt UI: https://github.com/audacious-media-player/audacious-plugins/blob/master/src/qtui/Makefile


Thanks

hefee

have you look into the variables that are setted by configure?
Have you tried to set these to the correct paths in the created files?

seasons

#8
EDIT: Never mind. I figured out that I had to pass both "--enable-qtui" and "--enable-qt" to automatically fill in the correct flags. Thank you for the clues!