PDA

View Full Version : Visual Studio 2010 and Qwt - Problem Compiling Programs



stonerbot613
8th November 2012, 18:24
This may be a better question to put on the Qwt subforum, but I'm an extreme newbie at this, so I'll post it in both places. Mods, feel free to delete whichever one you think needs to go.

I'm trying to do some preliminary research into Qwt for a future project and have run into program compilation issues when using Visual Studio 2010.
I'm basically trying to build and compile the spectrogram example from the qwt examples (not the exact files, just marginally tweaked). Visual Studio gives me the following output when building:

1>------ Rebuild All started: Project: Spectrogram, Configuration: Debug Win32 ------
1>Build started 11/8/2012 10:17:19 AM.
1>_PrepareForClean:
1> Deleting file "Debug\Spectrogram.lastbuildstate".
1>InitializeBuildStatus:
1> Touching "Debug\Spectrogram.unsuccessfulbuild".
1>CustomBuild:
1> Moc'ing spectrogram.h...
1> Uic'ing spectrogram.ui...
1> Rcc'ing spectrogram.qrc...
1>RCC : warning : No resources in 'C:\Users\xxxxxx\documents\visual studio 2010\Projects\Spectrogram\Spectrogram\spectrogram. qrc'.
1>
1>ClCompile:
1> moc_spectrogram.cpp
1> main.cpp
1> spectrogram.cpp
1> Generating Code...
1> qrc_spectrogram.cpp
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall QSvgGenerator::~QSvgGenerator(void)" (??1QSvgGenerator@@UAE@XZ) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: void __thiscall QSvgGenerator::setViewBox(class QRectF const &)" (?setViewBox@QSvgGenerator@@QAEXABVQRectF@@@Z) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: void __thiscall QSvgGenerator::setResolution(int)" (?setResolution@QSvgGenerator@@QAEXH@Z) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: void __thiscall QSvgGenerator::setFileName(class QString const &)" (?setFileName@QSvgGenerator@@QAEXABVQString@@@Z) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: void __thiscall QSvgGenerator::setTitle(class QString const &)" (?setTitle@QSvgGenerator@@QAEXABVQString@@@Z) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: __thiscall QSvgGenerator::QSvgGenerator(void)" (??0QSvgGenerator@@QAE@XZ) referenced in function "public: void __thiscall QwtPlotRenderer::renderDocument(class QwtPlot *,class QString const &,class QString const &,class QSizeF const &,int)" (?renderDocument@QwtPlotRenderer@@QAEXPAVQwtPlot@@ ABVQString@@1ABVQSizeF@@H@Z)
1>qwtd.lib(qwt_plot_renderer.obj) : error LNK2019: unresolved external symbol "public: class QRectF __thiscall QSvgGenerator::viewBoxF(void)const " (?viewBoxF@QSvgGenerator@@QBE?AVQRectF@@XZ) referenced in function "public: void __thiscall QwtPlotRenderer::renderTo(class QwtPlot *,class QSvgGenerator &)const " (?renderTo@QwtPlotRenderer@@QBEXPAVQwtPlot@@AAVQSv gGenerator@@@Z)
1>C:\Users\xxxxxx\documents\visual studio 2010\Projects\Spectrogram\Win32\Debug\\Spectrogram .exe : fatal error LNK1120: 7 unresolved externals

I think I understand that it's complaining about not being able to find the qwtd.lib library file. However, I've pointed VS2010 to this file several times without success. I do not know what to try next at this point. Can anybody help?

Installation and configuration notes:
* For Qt, I statically compiled the Qt source (4.8.3) using qmake from the Visual Studio 2010 command prompt (with the -static flag and -platform win32-msvc2010 flags among others). Basic Qt programs compile and run just fine in my setup.
* For Qwt 6.0.1, I modified the qwtconfig.pri to point to the correct path and to comment out the DLL line (in order to enable static compile).
* I then compiled Qwt with qmake -spec win32-msvc2010 qwt.pro, ran nmake, and then ran nmake install
* In my VS project settings, I made sure that the SRC path had both the Qt and Qwt src folders, the LIB path had both folders, and the INCLUDE path had the Qt include and Qwt source folder.
* Under the Linker Additional Dependencies, I pointed it to the qwtd.lib file

I've tried running Visual Studio by itself and through the Digia Qt Visual Studio shortcut - both have given me the above error with some slight massaging (I had to modify the qtvars.bat file to add in the correct SRC, LIB, and INCLUDE paths for the project).

Can anybody help?

santhoshpatil
26th November 2012, 06:35
Hi

Few days back i built Qwt foe visual studio 2010,, Here is what i have done

1. Instead of Building QT from the source, download Pre Built libraries available for Vs 2010 from the Qt website. Add the Qt bin folder path to the Path variable
2. Download the Latest Qwt i.e 6.0.1
3. Open the Visual Studio 2010 command prompt, not the normal Command prompt
4. do as suggested in the install file of the Qwt folder..i.e qmake Qwt.pro,nmake,nmake install...
5 .These are the steps i followed and was able to build the Qwt project successfully.

Uwe
26th November 2012, 09:09
I think I understand that it's complaining about not being able to find the qwtd.lib library file.
No it complains about missing symbols you find in the Qt SVG module.

Add the Qt SVG library to your linker list or when your Qt version has been build without SVG support also build Qwt without SVG support ( edit qwtconfig.pri ).

Uwe