Results 1 to 3 of 3

Thread: Visual Studio 2010 and Qwt - Problem Compiling Programs

  1. #1
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    1

    Default Visual Studio 2010 and Qwt - Problem Compiling Programs

    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?

  2. #2
    Join Date
    Sep 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Visual Studio 2010 and Qwt - Problem Compiling Programs

    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.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Visual Studio 2010 and Qwt - Problem Compiling Programs

    Quote Originally Posted by stonerbot613 View Post
    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

Similar Threads

  1. QtService start problem visual studio 2010
    By matteo.ceruti in forum Qt Programming
    Replies: 2
    Last Post: 24th December 2012, 09:22
  2. Replies: 4
    Last Post: 13th November 2012, 21:46
  3. Qt add in Visual Studio 2010 problem
    By qtmude in forum Installation and Deployment
    Replies: 2
    Last Post: 18th January 2012, 14:41
  4. Problem compiling QT 4,8,0 in windows 7 x64 with visual studio 2010
    By phate89 in forum Installation and Deployment
    Replies: 0
    Last Post: 11th January 2012, 17:14
  5. problem building 2009.3.1 with visual studio 2010 beta
    By majestik666 in forum Installation and Deployment
    Replies: 2
    Last Post: 25th September 2009, 04:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.