PDA

View Full Version : Fail to compile something rely on Qt4



kfc123
2nd July 2009, 18:39
I am compiling bacula which rely on qt4.3 or above, but my only have qt4.2 so it reports following error

ui/ui_main.h: In member function ‘void Ui_MainForm::setupUi(QMainWindow*)’:
ui/ui_main.h:168: error: ‘class QGridLayout’ has no member named ‘setLeftMargin’
ui/ui_main.h:169: error: ‘class QGridLayout’ has no member named ‘setTopMargin’
ui/ui_main.h:170: error: ‘class QGridLayout’ has no member named
‘setRightMargin’
ui/ui_main.h:171: error: ‘class QGridLayout’ has no member named
‘setBottomMargin’
ui/ui_main.h:172: error: ‘class QGridLayout’ has no member named
‘setHorizontalSpacing’
ui/ui_main.h:173: error: ‘class QGridLayout’ has no member named
‘setVerticalSpacing’
ui/ui_main.h:224: error: ‘class QGridLayout’ has no member named ‘setLeftMargin’
ui/ui_main.h:225: error: ‘class QGridLayout’ has no member named ‘setTopMargin’
ui/ui_main.h:226: error: ‘class QGridLayout’ has no member named
‘setRightMargin’
ui/ui_main.h:227: error: ‘class QGridLayout’ has no member named
‘setBottomMargin’
ui/ui_main.h:228: error: ‘class QGridLayout’ has no member named
‘setHorizontalSpacing’
ui/ui_main.h:229: error: ‘class QGridLayout’ has no member named

I know this is due to mismatch of qt verison, so I download qt-x11-opensource-src-4.5.2.tar.gz from this site, install it to /usr/local/Trolltech/Qt-4.5.2 and set the following environment

export QTDIR=/usr/local/Trolltech/Qt-4.5.2
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTINC=$QTDIR/include
export QTLIB=$QTDIR/lib

after reboot the system, I didn't see it help! Am I doing something wrong? How to make qt-4.5.2 works in this problem?

Thanks

wysota
2nd July 2009, 20:11
Make sure you run make distclean and rerun qmake before running make again.