Problem compiling a KDE2 app
Hi,
I have a problem compiling KDE2 apps. Whenever I do "./configure" I
get:
checking for Qt... configure: error: Qt (>= Qt 2.2.2) (libraries) not
found. Please check your installation!
For more details about this problem, look at the end of config.log.
configure checks for Qt by trying to compile this program:
conftest.C:
-----------
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qapp.h>
#include <qobjcoll.h>
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <qiconview.h>
#if ! (QT_VERSION >= 222)
#error 1
#endif
int main() {
QStringList *t = new QStringList();
QIconView iv(0);
v.setWordWrapIconText(false);
QString s;
s.setLatin1("Elvis is alive", 14);
int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
return 0;
}
//-----------------------------------------------------------
confdefs.h:
-----------
#define PACKAGE "khello2"
#define VERSION "0.1"
#define HAVE_TEMPLATE_REPOSITORY 1
#define HAVE_CRYPT 1
#define ksize_t socklen_t
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_CHAR_P 4
#define HAVE_LIBZ 1
#define HAVE_LIBPNG 1
#define HAVE_LIBJPEG 1
//-------------------------------------------------------------
configure tries to compile this with:
g++ -o conftest -O2 -fno-exceptions -fno-check-new -Wall -pedantic -W
-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long
-Wnon-virtual-dtor -fno-builtin -I/usr/include/qt
-I/usr/X11R6/include -L/usr/lib -L/usr/X11R6/lib conftest.C -lqt
-lpng -lz -lm -ljpeg -lXext -lX11 -lSM -lICE
This results in undefined references:
/usr/lib/libqt.a(qfont_x11.o): In function `QFont::initFontInfo(void)
const':
qfont_x11.o(.text+0x1041): undefined reference to
`XftPatternGetString'
qfont_x11.o(.text+0x1052): undefined reference to
`XftPatternGetInteger'
qfont_x11.o(.text+0x1066): undefined reference to
`XftPatternGetInteger'
qfont_x11.o(.text+0x1077): undefined reference to
`XftPatternGetInteger'
/usr/lib/libqt.a(qfont_x11.o): In function `QFont::load(void) const':
qfont_x11.o(.text+0x20a7): undefined reference to `XftFontOpen'
/usr/lib/libqt.a(qfont_x11.o): In function
`QFontMetrics::inFont(QChar) const':
qfont_x11.o(.text+0x5628): undefined reference to `XftGlyphExists'
/usr/lib/libqt.a(qfont_x11.o): In function `getExt(QString, int,
XRectangle &, XRectangle &, _XOC *, _XftFont *, QTextCodec const *)':
qfont_x11.o(.text+0x5b54): undefined reference to `XftTextExtents16'
/usr/lib/libqt.a(qfont_x11.o): In function
`QFontMetrics::leftBearing(QChar) const':
qfont_x11.o(.text+0x5cbf): undefined reference to `XftTextExtents32'
/usr/lib/libqt.a(qfont_x11.o): In function
`QFontMetrics::rightBearing(QChar) const':
qfont_x11.o(.text+0x5f0b): undefined reference to `XftTextExtents32'
/usr/lib/libqt.a(qfont_x11.o): In function
[snip (would be too long to post)]
The strange thing is that if I compile the same program with adding
"-lkdecore" to the parameter list of g++ then it compiles. I even can
leave out a lot of the other libraries. It also compiles with:
g++ -o conftest -I/usr/include/qt -I/usr/X11R6/include
-L/usr/X11R6/lib conftest.C -lqt -lkdecore
It wouldn't bother me linking my KDE apps with kdecore, but the
configure scripts of all KDE apps I tested don't do that. So it fails
to find Qt and because of that not letting me easily compile KDE apps.
Does anybody has a hint for me?
I have installed:
ii libqt-dev 2.3.0-final-5
ii libqt2 2.3.1-3
ii kdebase-dev 2.1.1.0-10
ii kdelibs-dev 2.1.2-3
ii g++ 2.95.4-4
without any unmet dependencies.
The Qt and KDE libs and includes are at the right places. $QTDIR,
$KDEDIR and $LD_LIBRARY_PATH are set although this shouldn't be
necessary because of the -L option and /etc/ld.so.conf.
I searched the web and various newsgroups but I found no solution to
this problem.
Any help is appreciated. :-)
Ciao, Jan
Reply to: