Results 1 to 5 of 5

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 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    no, it says qwtd.lib(qwt_plot_renderer.obj) cannot find qsvgGenerator

    so it is trying to build qwt_plot_renderer.obj. I doubt it should be doing this since you should only need your app to link with qwtd.lib
    Last edited by amleto; 9th November 2012 at 19:22.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. The following user says thank you to amleto for this useful post:

    stonerbot613 (9th November 2012)

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

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

    Thanks for the answer!
    I guess it helps to read everything multiple times before asking a stupid question. I commented out all of the print functionality from the spectrogram example and it ran just fine.
    I guess this begs the question, why did this happen? Could something have gotten messed up during the original Qt build?

  5. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    are you sure you weren't rebuilding qwt?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  6. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

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

    Does your Qt project include?
    Qt Code:
    1. QT += svg
    To copy to clipboard, switch view to plain text mode 
    This will add the Qt SVG library into the link command.

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. Qt add in Visual Studio 2010 problem
    By qtmude in forum Installation and Deployment
    Replies: 2
    Last Post: 18th January 2012, 14:41
  3. 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
  4. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 16:46
  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.