PDA

View Full Version : Qwt library building problem



Aspirisha
7th December 2013, 13:23
Hello there.
I'm trying to build QWT library (http://qwt.sourceforge.net/), and while compiling I get some ridiculous compilation errors, like . For exapmle,

qwt_legend.cpp:226: error: 'class QWidget' has no member named 'layout'
qwt_legend.cpp: In member function 'void QwtLegend::setMaxColumns(uint)'

Looking into source I saw some strange expression on 226 line of this file:



void layoutContents()
{
const QwtDynGridLayout *tl = qobject_cast<QwtDynGridLayout *>(
contentsWidget->layout() );


Here contentsWidget has type of QWidget*. So, it really has no member function layout(). So, I don't know what to think. Even more, in whole project I have found no object having such a function. Isn't it a bit weird? I'm totally sure I don't understand something simple, but I really can't understand what is it exactly.

ChrisW67
7th December 2013, 20:59
Here contentsWidget has type of QWidget*. So, it really has no member function layout().
Of course it does: QWidget::layout()

Exactly which version of Qwt, which version of Qt, which platform? Post the first couple of error messages and the compiler call that produced them.

Aspirisha
7th December 2013, 21:30
Of course it does: QWidget::layout()

Exactly which version of Qwt, which version of Qt, which platform? Post the first couple of error messages and the compiler call that produced them.

Qt 4.8.1
As for Qwt, I tried 6.1.0 and 6.0.2.
Platform - windows 7, 64bit.

Compiler call:

C:\qwt-6.1.0>make
cd src\ && c:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\qmake.exe c:\qwt-6.1.0\src\src.pr
o -o Makefile
cd src\ && make -f Makefile
make[1]: Entering directory `C:/qwt-6.1.0/src'
make -f Makefile.Debug all
make[2]: Entering directory `C:/qwt-6.1.0/src'
compiling qwt_abstract_scale_draw.cpp
compiling qwt_clipper.cpp
....
compiling qwt_legend.cpp
qwt_legend.cpp: In member function 'void QwtLegend::PrivateData::LegendView::layoutContents ()':
qwt_legend.cpp:226: error: 'class QWidget' has no member named 'layout'
qwt_legend.cpp: In member function 'void QwtLegend::setMaxColumns(uint)':
qwt_legend.cpp:295: error: 'class QWidget' has no member named 'layout'qwt_legend.cpp:
In member function 'uint QwtLegend::maxColumns() const':
qwt_legend.cpp:309: error: 'class QWidget' has no member named 'layout'
qwt_legend.cpp: In member function 'virtual void QwtLegend::updateLegend(const Q
Variant&, const QList<QwtLegendData>&)':
...

ChrisW67
8th December 2013, 01:10
Qwt 6.0.2 and 6.1.0 build cleanly for me using 4.8.0 and 4.8.4 and MingW on Windows. I don't have a Qt 4.8.1 to hand.

Try a clean build, using the Qt 4.8.1 qmake after commenting out the following line in qwtbuild.pri:


CONFIG += silent


BTW: Why use an old version of Qt?