xca icon indicating copy to clipboard operation
xca copied to clipboard

Problems building xca 2.4 on Ubuntu with qt5

Open OevreFlataeker opened this issue 4 years ago • 1 comments

I am currently still using the Ubuntu-repo version of xca in version 2.2.1 on Ubuntu 20.04 LTS. With this version I am not able to use the "Import" function in the certificate signing request tab. The app just hangs without any error and I need to kill it. So I tried building 2.4.0 from scratch.

The configure run bails out with errors about missing QT dependencies.

The packages qt5-assistant, qt5-default, qt5-qmake, qt5-qmake-bin from the Ubuntu repos are all installed on my system.

So I thought, maybe the qt5 stuff is too scattered so I tried building qt5 from the sources and installed it all in /opt/qt5/qtbase. Everything regarding qt5 is now directly below /opt/qt5/qtbase and no longer scattered in various places (include, lib, bin, ...)

My configure line for xca looks like this:

CPPFLAGS="$CPPFLAGS -I/opt/qt5/qtbase/include -I/opt/qt5/qtbase/include/QtCore -I/opt/qt5/qtbase/include/QtCore/QString" ./configure --with-qt=/opt/qt5/qtbase --with-qt-version 5

configure now runs, but still prints

checking for Qt5... no
checking for Qt4... no
configure: WARNING: Qt pkg-config failed, using fallback defaults ( -lQtCore -lQtGui )

Running make results in a myriad of errors. First of all qglobal.h is missing (that's why I added the explicit -I/opt/qt5/qtbase/include/QtCore above), but then still QString is missing.

 daubsi@bigigloo  ~/xca-2.4.0  make
  GEN    commithash.h
  CC     [lib] db_crl.o
In file included from db_base.h:12,
                 from db_key.h:11,
                 from db_x509super.h:12,
                 from db_crl.h:11,
                 from db_crl.cpp:9:
db.h:15:10: fatal error: QString: No such file or directory
   15 | #include <QString>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [/home/daubsi/xca-2.4.0/Rules.mak:34: db_crl.o] Error 1
make: *** [Makefile:90: lib/.build-stamp] Error 2

I never used Qt before but I'd presume I am not supposed to add a -I <dirname> for each of the 70+ directories below? Actually I presume I am not supposed to add anything manually when specifying the --qt-dir? I also tried running pkg-config --list-all - there is no qt in the results.

What am I doing wrong?

OevreFlataeker avatar Mar 19 '22 08:03 OevreFlataeker

I just found this already-closed issue https://github.com/chris2511/xca/issues/299 and indeed apt-get install qttools5-dev let's configure immediately find all qt related stuff.

configure: The Versions of the used libraries are:
configure: Header:
configure:      OpenSSL 1.1.1n  15 Mar 2022 0x101010efL
configure:      QT: 5.15.2
configure: Libraries:
configure:      OpenSSL 1.1.1n  15 Mar 2022
configure:      QT: 5.15.2
configure: ECC With RFC 5639 Brainpool curves enabled
checking for GNU make... make

Yet I am wondering what's wrong when I explicitly specify the path to my custom qt5 installation dir at /opt/qt5/qtbase. Shouldn't that approach have worked the same way?

OevreFlataeker avatar Mar 19 '22 08:03 OevreFlataeker