PDA

View Full Version : qt 3.3.6 + qwt-5.0.2 + WinXP + MSVisualStudio 6.0



Times
7th December 2007, 14:05
Hello!

I'm using qt 3.3.6 (winXP and C++ Visual Studio 6.0) and I'd like to install qwt-5.0.2
I've read http://qwt.sourceforge.net/qwtinstall.html for my case it says:
----------
B) Win32/MSVC Qt3/Qt4
=====================
Please read the qmake documentation how to convert
your *.pro files into your development environment.

F.e MSVC with nmake:
qmake qwt.pro
nmake
----------

But I've got the following error while doing nmake:
---------------------------------
[...]

.\qwt_panner.cpp(53) : error C2666: '[]' : 2 overloads have similar conversions
.\qwt_panner.cpp(374) : error C2374: 'i' : redefinition; multiple initialization

.\qwt_panner.cpp(368) : see declaration of 'i'

[...]

Generating Code...
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.
----------------------------------

Maybe I forgot something..
can somebody help me out?..

Thanks a lot!!

DeepDiver
7th December 2007, 16:59
Sounds like the MSVC6.0 compiler doesn't like some piece of qwt code.
You have the latest service pack of MSVC installed?

Good luck,

Tom

Uwe
7th December 2007, 17:12
I don't know very much about the capabilities of the different MSVC releases, but both problems are compiler problems and you need to patch the Qwt code to work around them:

1) qwt_panner.cpp(53)
Change the cast ( guess to uint ).

2) qwt_panner.cpp(374)
Rename i to j.

Uwe

Times
7th December 2007, 18:03
Yep, thanks, I've already solved the first error:

---------------------------
[...]
QwtArray<QwtPicker *> pickers = activePickers(parentWidget());
/*CHANGED>*/ {
for ( int i = 0; i < (int)pickers.size(); i++ )
pickers[i]->setEnabled(false);
/*CHANGED>*/ }

d_data->pixmap = QPixmap::grabWidget(parentWidget(),
cr.x(), cr.y(), cr.width(), cr.height());

/*CHANGED>*/ {
for ( int i = 0; i < (int)pickers.size(); i++ )
pickers[i]->setEnabled(true);
/*CHANGED>*/ }

show();
}
[...]
---------------------------

Next, I've changed the cast to uint here:

---------------------------
[...]
#else
QObjectList *children = (QObjectList *)w->children();
if ( children )
{
for ( QObjectListIterator it(*children); it.current(); ++it )
{
QObject *obj = (QObject *)it.current();
if ( obj->inherits("QwtPicker") )
{
QwtPicker *picker = (QwtPicker *)obj;
if ( picker->isEnabled() )
{
pickers.resize(pickers.size() + 1);
/*HERE>>>>>*/ pickers[pickers.size() - 1] = (uint)picker;
}
}
}
}
#endif

return pickers;
}
[...]
---------------------------

But still the same error

.\qwt_panner.cpp(53) : error C2666: '[]' : 2 overloads have similar conversions


I'll look into it tomorrow =)

Thanks!!
Bon weekend!

Times
10th December 2007, 15:42
FYI:

Everything works fine with following modifications I've made:
=================================
#else
QObjectList *children = (QObjectList *)w->children();
if ( children )
{
for ( QObjectListIterator it(*children); it.current(); ++it )
{
QObject *obj = (QObject *)it.current();
if ( obj->inherits("QwtPicker") )
{
QwtPicker *picker = (QwtPicker *)obj;
if ( picker->isEnabled() )
{
pickers.resize(pickers.size() + 1);
pickers[(int)pickers.size() - 1] = picker; //!!!!! HERE
// pickers[pickers.size() - 1] = picker;
}
}
}
}
#endif
===============================

Thanks!