PDA

View Full Version : QWT Installation QT Designer Plugin



stpwhd
22nd October 2012, 17:02
Hi there,

firstable, I am quite new to qt programming (less than one year). But now I need to show a kind of diagram, and I'd like to use qwt for it.

Unfortunatly, I'm not able, to get this installation working - maybe someone can help me out here.

My standard QT Verison is 4.8.2., and it is working properly with Visual Studio 2010. I am using QT for Visual Studio 2010 with Plugin 1.1.11. So I guess QT is compiled correctly.

Now I try to install qwt. I downloaded a verion 6.0.0 from sourcforge.net, which already is configured in this way:

CONFIG += debug_and_release
CONFIG += build_all
QWT_CONFIG += QwtDll

If I leave this config so, doing:

qmake qwt.pro
nmake

I will receive some errors regarding unresolved externals pointing to a dll-file, resulting in a fatal error after a while...

If I change the config to static build:

# QWT_CONFIG += QwtDll

everything works fine, everything is compiled and also the examples work (after an aditional "nmake install").

But I need to have the QWT widgets in the QT Designer available. But there is no such qwt_designer_plugin.dll file generated. just a qwt_designer_plugin.lib file.
I tried to copy it to C:\Qt\4.8.2\plugins\designer. (just the .lib file)

But after starting the QT Designer, there are no qwt widgets available in the left side. Also deleting the registry-entries, some website point to, will not solve the problem.
I can't see any qwt widget in the designer. The Designer also dosn't show it under failed plugins.

I red something about, that i need to compile qwt twice with the version, the designer is build with. So can anyone tell me, which exact version I need, to compile qwt with?
I tried with 4.8.3, and the designer tells me based on 4.8.3, abut the results with compiling qwt is the same as stated above, when I compile qwt with 4.8.3.

I also made a complete new installation of an old VS2008 (on another fresh installed PC), and tried also with 4.8.3 and with qwt 6.0.1. Results are exactly the same.

Has anyone an idea, how to get this working?

thanks in advance,

Steffen

Uwe
23rd October 2012, 07:20
Now I try to install qwt. I downloaded a verion 6.0.0 from sourcforge.net, ...:
What is the point in not using 6.0.1 - anyway continue with the advices in INSTALL.

Take care that the version of qmake you are using is from the the Qt installation you want to have Qwt built for. Also take care that your version of Qt has been built with a compatible compiler.


qmake qwt.pro
nmake

I will receive some errors regarding unresolved externals pointing to a dll-file, resulting in a fatal error after a while...

Now its to time fix this problem - anything else is a waste of time.

Uwe

stpwhd
23rd October 2012, 17:54
What is the point in not using 6.0.1 - anyway continue with the advices in INSTALL.

Now its to time fix this problem - anything else is a waste of time.

Uwe

Hi Uwe,

Actually, what I did is the following:

downloaded QT libs 4.8.3 for VS2010. Installed them to C:\Qt\4.8.3

configured it static with and compiled with:

configure -debug-and-release -static -platform win32-msvc2010
nmake sub-src

after that defined my Variables:

%QTDIR%=C:\Qt\4.8.3
%QWTDIR%=C:\qwt-6.0.1
%QT_PLUGIN_PATH%=C:\Qt\4.8.3\plugins

I extendet my path variable to: C:\Qt\4.8.3\bin;C:\Qt\4.8.3\lib;C:\qwt-6.0.1\lib

QT is working perfectly with VS2010 and 4.8.3. I made some test projects without any problems, errors or warnings.

Than I downloaded and uncompressed QWT 6.0.1 to C:\qwt-6.0.1

I did not change any settings in the files, I just run the things you stated in the INSTALL file from the visual studio x86 command prompt:

cd \qwt-6.0.1
qmake qwt.pro
nmake

Here it will start compiling fine so far, until the .moc files, and then a massive warning spamming occours resulting in a later break with a fatal error starting with:

moc_qwt_slider.cpp
moc_qwt_thermo.cpp
moc_qwt_wheel.cpp
Generating Code...
linking ..\lib\qwtd.dll
Creating library ..\lib\qwtd.lib and object ..\lib\qwtd.exp
moc_qwt_analog_clock.obj : warning LNK4049: locally defined symbol ??1QString@@QAE@XZ (public: __thiscall QString::~QString(void)) imported
moc_qwt_compass.obj : warning LNK4049: locally defined symbol ??1QString@@QAE@XZ (public: __thiscall QString::~QString(void)) imported
moc_qwt_dial.obj : warning LNK4049: locally defined symbol ??1QString@@QAE@XZ (public: __thiscall QString::~QString(void)) imported

this will continue several pages (if you want the complete log, let me know)...

ending with:

qwt_knob.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) double const * const qt_sine_table" (__imp_?qt_sine_table@@3QBNB)
qwt_wheel.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) double const * const qt_sine_table" (__imp_?qt_sine_table@@3QBNB)
..\lib\qwtd.dll : fatal error LNK1120: 35 unresolved externals


However, if I do the same, just by changing to static build:

# QWT_CONFIG += QwtDll

everything is built fine. Except, that there is no plugin for the designer created. The only file for the designer plugin that is generated is the .lib file. But with just the .lib file, the designer will not show qwt widgets (even as failed).

If I than compile the examples, everything works fine. Examples are working as expected!

This is, what confuses me. Since the compiling works in static config, and also the examples work, I think everything should work fine. Except, that the designer plugin is not generated completly.

It seems, that there is an issue with generating the .dll files.

You got some hint for me?

kr,
Steffen

Uwe
23rd October 2012, 22:51
Well you can't load a static library as plugin.

But before you spend too much work on building the plugin: there is not much benefit in it compared to writing real code. Especially the plot widget you are interested in doesn't offer many properties you can set in the designer - all plot items ( and its attributes ) must be configured in code anyway.

Uwe