Results 1 to 8 of 8

Thread: Linking problems with files containing QWT code

  1. #1

    Default Linking problems with files containing QWT code

    Hi,

    I am not sure whether it is directly a QWT problem, however for me it occures in that context. And since I dont know where else to post I will try it here:

    I created a project in VS2008 using a cmake file. And as soon as I add QWT code the linker errors at the end of this post occure.
    I assume it is somehow related to a missing QWT library. I added the library directory in the project properties of Visual Studio, but it does not seem to help. Maybe someone else has an idea.

    Reagards

    2>Linking...
    2> Creating library C:\Alpha_Histogram_Installed\Debug\dgTest.lib and object C:\Diplomarbeit\Alpha_Histogram_Installed\Debug\dg Test.exp
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall QwtPlotItem::~QwtPlotItem(void)" (??1QwtPlotItem@@UAE@XZ) referenced in function "public: virtual __thiscall HistogramItem::~HistogramItem(void)" (??1HistogramItem@@UAE@XZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlotItem::QwtPlotItem(class QwtText const &)" (??0QwtPlotItem@@QAE@ABVQwtText@@@Z) referenced in function "public: __thiscall HistogramItem::HistogramItem(class QwtText const &)" (??0HistogramItem@@QAE@ABVQwtText@@@Z)
    2>histogram_item.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QwtPlotItem::updateLegend(class QwtLegend *)const " (?updateLegend@QwtPlotItem@@UBEXPAVQwtLegend@@@Z)
    2>histogram_item.obj : error LNK2001: unresolved external symbol "public: virtual class QWidget * __thiscall QwtPlotItem::legendItem(void)const " (?legendItem@QwtPlotItem@@UBEPAVQWidget@@XZ)
    2>histogram_item.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QwtPlotItem::setVisible(bool)" (?setVisible@QwtPlotItem@@UAEX_N@Z)
    2>histogram_item.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QwtPlotItem::itemChanged(void)" (?itemChanged@QwtPlotItem@@UAEXXZ)
    2>histogram_item.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QwtPlotItem::updateScaleDiv(class QwtScaleDiv const &,class QwtScaleDiv const &)" (?updateScaleDiv@QwtPlotItem@@UAEXABVQwtScaleDiv@@ 0@Z)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::~QwtText(void)" (??1QwtText@@QAE@XZ) referenced in function "public: __thiscall HistogramItem::HistogramItem(class QString const &)" (??0HistogramItem@@QAE@ABVQString@@@Z)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::QwtText(class QString const &,enum QwtText::TextFormat)" (??0QwtText@@QAE@ABVQString@@W4TextFormat@0@@Z) referenced in function "public: __thiscall HistogramItem::HistogramItem(class QString const &)" (??0HistogramItem@@QAE@ABVQString@@@Z)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtIntervalData::~QwtIntervalData(void)" (??1QwtIntervalData@@QAE@XZ) referenced in function "public: __thiscall HistogramItem::PrivateData::~PrivateData(void)" (??1PrivateData@HistogramItem@@QAE@XZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotItem::setZ(double)" (?setZ@QwtPlotItem@@QAEXN@Z) referenced in function "private: void __thiscall HistogramItem::init(void)" (?init@HistogramItem@@AAEXXZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotItem::setItemAttribute(enum QwtPlotItem::ItemAttribute,bool)" (?setItemAttribute@QwtPlotItem@@QAEXW4ItemAttribut e@1@_N@Z) referenced in function "private: void __thiscall HistogramItem::init(void)" (?init@HistogramItem@@AAEXXZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtIntervalData::QwtIntervalData(void)" (??0QwtIntervalData@@QAE@XZ) referenced in function "public: __thiscall HistogramItem::PrivateData::PrivateData(void)" (??0PrivateData@HistogramItem@@QAE@XZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: class QRectF __thiscall QwtIntervalData::boundingRect(void)const " (?boundingRect@QwtIntervalData@@QBE?AVQRectF@@XZ) referenced in function "public: virtual class QRectF __thiscall HistogramItem::boundingRect(void)const " (?boundingRect@HistogramItem@@UBE?AVQRectF@@XZ)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: static void __cdecl QwtPainter::drawLine(class QPainter *,int,int,int,int)" (?drawLine@QwtPainter@@SAXPAVQPainter@@HHHH@Z) referenced in function "protected: virtual void __thiscall HistogramItem::drawBar(class QPainter *,enum Qt::Orientation,class QRect const &)const " (?drawBar@HistogramItem@@MBEXPAVQPainter@@W4Orient ation@Qt@@ABVQRect@@@Z)
    2>histogram_item.obj : error LNK2019: unresolved external symbol "public: static void __cdecl QwtPainter::drawRect(class QPainter *,int,int,int,int)" (?drawRect@QwtPainter@@SAXPAVQPainter@@HHHH@Z) referenced in function "protected: virtual void __thiscall HistogramItem::drawBar(class QPainter *,enum Qt::Orientation,class QRect const &)const " (?drawBar@HistogramItem@@MBEXPAVQPainter@@W4Orient ation@Qt@@ABVQRect@@@Z)
    2>C:\Alpha_Histogram_Installed\Debug\dgTest.exe : fatal error LNK1120: 16 unresolved externals
    2>Build log was saved at "file://c:\Alpha_Histogram_Installed\dgTest.dir\Debug\Buil dLog.htm"
    2>dgTest - 17 error(s), 3 warning(s)
    3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
    3>Project not selected to build for this solution configuration
    ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linking problems with files containing QWT code

    It's not that simple. You have to link to the library itself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: Linking problems with files containing QWT code

    Could you please explain that in more detail?

    I already build the qwt library, and the test examples included do also work.
    Howerver as soon as I try to include QWT code in my project the errors shown above occur.
    Moreover usual Qt code does also work. Is it probably necessary to add additional code in the .cmake file to add qwt as well?

    Maybe you can tell me what else needs to be done, or where I can find closer Information.

    Thanks and Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linking problems with files containing QWT code

    Quote Originally Posted by sacrif View Post
    Could you please explain that in more detail?
    Come on, man... you do know what a dynamically linked library is, right? I'm sure if you search the forum, you will find an answer to your problem. Especially that I just answered a very similar question in another thread. You can join forces looking for the answer.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: Linking problems with files containing QWT code

    I am sorry to bother you with low level questions, but I am completly new to all these tools and am a little overstrained atm:/ But I think thats what the Newbie forum is for.

    I know what a dll is, but I I still don't know how I can link it to my project, or what exactly the problem is. Is it possible that the problem lies in missing details in the .cmake file?
    Sorry again for the newbish questions, but maybe someone can still give me an idea what to do, or a link to related topic.

    Thanks

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linking problems with files containing QWT code

    Quote Originally Posted by sacrif View Post
    I am sorry to bother you with low level questions, but I am completly new to all these tools and am a little overstrained atm:/ But I think thats what the Newbie forum is for.
    This is a newbie forum for Qt programmers, not to newbie programmers at all.

    I won't tell you how to do it with cmake as I don't use cmake myself, for qmake you have to tell it to link your application against the library by changing the LIBS variable.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Linking problems with files containing QWT code

    Just take a look at "target_link_libraries" in the cmake documentation...

  8. #8
    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: Linking problems with files containing QWT code

    Have a look at the snippet from a .pro file that links to Qwt for a hint:
    http://www.qtcentre.org/forum/f-newb...lem-26366.html

Similar Threads

  1. Problems with loading ui files on windows
    By tyrdal in forum Qt Programming
    Replies: 2
    Last Post: 5th August 2009, 11:42
  2. header files problems
    By dognzhe in forum General Programming
    Replies: 1
    Last Post: 18th May 2009, 08:00
  3. Replies: 0
    Last Post: 23rd April 2009, 09:38
  4. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28
  5. Replies: 3
    Last Post: 30th January 2006, 15: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.