Problems with uic / cmake (missing -L kde_widgetdir)
Michael Biebl
mbiebl at gmail.com
Thu Aug 31 00:09:48 CEST 2006
Recently the build system of kdesvn [1], a KDE3 application, was
switched from auto* to cmake.
Unfortunately the build fails for me (running a Debian unstable box
with latest KDE and qt3).
The build fails on compilation of logmessage.cpp, which is a
autogenerated file by uic using logmessage.ui. The logmessage.ui file
contains a KTextEdit element. The error message is:
[ 23%] Building CXX object
src/ksvnwidgets/CMakeFiles/ksvnwidgets.dir/logmessage.o
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:
In constructor 'LogmessageData::LogmessageData(QWidget*, const char*,
uint)':
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:53:
error: invalid use of undefined type 'struct KTextEdit'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.h:23:
error: forward declaration of 'struct KTextEdit'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:54:
error: no matching function for call to
'QVBoxLayout::addWidget(KTextEdit*&)'
/usr/share/qt3/include/qlayout.h:386: note: candidates are: void
QBoxLayout::addWidget(QWidget*, int, int)
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:64:
error: invalid use of undefined type 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.h:24:
error: forward declaration of 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:65:
error: invalid use of undefined type 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.h:24:
error: forward declaration of 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:67:
error: no matching function for call to
'QGridLayout::addWidget(KComboBox*&, int, int)'
/usr/share/qt3/include/qlayout.h:331: note: candidates are: void
QGridLayout::addWidget(QWidget*, int, int, int)
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:79:
error: no matching function for call to
'LogmessageData::connect(KComboBox*&, const char [16], LogmessageData*
const, const char [27])'
/usr/share/qt3/include/qobject.h:116: note: candidates are: static
bool QObject::connect(const QObject*, const char*, const QObject*,
const char*)
/usr/share/qt3/include/qobject.h:226: note: bool
QObject::connect(const QObject*, const char*, const char*) const
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:
In member function 'virtual void LogmessageData::languageChange()':
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:102:
error: invalid use of undefined type 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.h:24:
error: forward declaration of 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:103:
error: invalid use of undefined type 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.h:24:
error: forward declaration of 'struct KComboBox'
/tmp/buildd/kdesvn-0.9.2/./obj-i486-linux-gnu/src/ksvnwidgets/logmessage.cpp:104:
error: no matching function for call to 'QToolTip::add(KComboBox*&,
QString)'
/usr/share/qt3/include/qtooltip.h:94: note: candidates are: static
void QToolTip::add(QWidget*, const QString&)
/usr/share/qt3/include/qtooltip.h:96: note: static
void QToolTip::add(QWidget*, const QString&, QToolTipGroup*, const
QString&)
/usr/share/qt3/include/qtooltip.h:99: note: static
void QToolTip::add(QWidget*, const QRect&, const QString&)
/usr/share/qt3/include/qtooltip.h:101: note: static
void QToolTip::add(QWidget*, const QRect&, const QString&,
QToolTipGroup*, const QString&)
make[3]: *** [src/ksvnwidgets/CMakeFiles/ksvnwidgets.dir/logmessage.o] Error 1
It seems, that the autogenerated *.cpp file is missing a ktextedit.h
include. After investigating the problem, I found that autotools
contains a m4 macro:
KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
On Debian this means that autotools calls uic with the parameter
"-L /usr/lib/kde3/plugins/designer".
But KDE3_ADD_UI_FILES (KDE3Macros.cmake) does not contain a
comparable check and so does not pass the -L flag with the correct
path to uic. It seems that uic needs the correct library patch via -L
or otherwise it creates uncompilable files.
What can I do now, to get the compilation going? Should I wait for
cmake-2.4.4 with a fixed KDE3_ADD_UI_FILES macro? Or there other ways
to work around this problem until it is fixed properly?
Cheers,
Michael
BTW: The KDE4_ADD_UI_FILES seems to be affected too and should be fixed too.
[1] http://www.alwins-world.de/programs/kdesvn/
More information about the Kde-buildsystem
mailing list