Results 1 to 7 of 7

Thread: unresolved external symbol with qwt3d

  1. #1
    Join Date
    Feb 2008
    Posts
    157
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default unresolved external symbol with qwt3d

    I am trying to use the libary qwt3d.

    I created a simple class to use it:

    Qt Code:
    1. #ifndef QPLOT3D_H_
    2. #define QPLOT3D_H_
    3.  
    4. #include <qwt3d_surfaceplot.h>
    5. #include <qwt3d_function.h>
    6.  
    7. using namespace Qwt3D;
    8.  
    9. class QPlot3D : public SurfacePlot
    10. {
    11. Q_OBJECT
    12. public:
    13. QPlot3D(QWidget* parent = 0, Qt::WFlags flags = 0);
    14. virtual ~QPlot3D();
    15.  
    16. };
    17. #endif
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "QPlot3D.h"
    2.  
    3. QPlot3D::QPlot3D( QWidget* parent /*= 0*/, Qt::WFlags flags /*= 0*/ )
    4. : SurfacePlot(parent)
    5. {
    6. }
    7.  
    8. QPlot3D::~QPlot3D()
    9. {
    10. }
    To copy to clipboard, switch view to plain text mode 

    which results only in the linker error:
    1>moc_QPlot3D.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const Qwt3D::SurfacePlot::staticMetaObject" (?staticMetaObject@SurfacePlot@Qwt3D@@2UQMetaObjec t@@B)
    the libary (.lib) files are loaded, the moc file is part of the project and compiled.
    Therefore I do not see what is missing.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: unresolved external symbol with qwt3d

    looks ok, are you sure you're linking against the qwt3d library? (might be there is another version and you have the wrong one?)

  3. #3
    Join Date
    Feb 2008
    Posts
    157
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: unresolved external symbol with qwt3d

    Quote Originally Posted by caduel View Post
    looks ok, are you sure you're linking against the qwt3d library? (might be there is another version and you have the wrong one?)
    How could I check if the version is correct?

    I am using VS 2005 and Qt 4.5.2

  4. #4
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: unresolved external symbol with qwt3d

    sorry, linux user here. i'd just use the disk search and search for qwt3d libs and includes (you know the names). if you get multiple hits, that might be the issue. (might be a bug in qwt3d, too, though. never used it.)

  5. #5
    Join Date
    Feb 2008
    Posts
    157
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: unresolved external symbol with qwt3d

    I would get multiple hits, but the lib file is in the correct project directory and the dll in the bin path of the project.

    So everything happens in the project paths and nothing in the system is involved.

  6. #6
    Join Date
    Apr 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: unresolved external symbol with qwt3d

    I know I'm a little bit late, but this might help somebody.

    I had the exactly same problem you were having, and after many hours of googling and messing with my project's properties I think I may have found a solution.

    I compared a working example with my own code, and found out the PREPROCESSOR definitions were pretty different.
    I have just copy pasted those definitions (from the "autoswitch" provided example) and everything compiled just fine.

    Note that for debug and release versions, the definitions change quite a little. If you have any doubt of which one to use, I would recommend you to check the PREPROCESSOR label of the autoswitch example.

    These are the following definitions that are provided in the example (the ones you should copy to your own project).

    For Debug mode:

    _WINDOWS;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_DLL ;QWT3D_DLL;QT_THREAD_SUPPORT;QT_OPENGL_LIB;QT_GUI_ LIB;QT_CORE_LIB



    For Release mode:

    QT_NO_DEBUG,NDEBUG,_WINDOWS,UNICODE,WIN32,QT_LARGE FILE_SUPPORT,QT_DLL,QWT3D_DLL,QT_THREAD_SUPPORT,QT _DLL,QT_NO_DEBUG,QT_OPENGL_LIB,QT_GUI_LIB,QT_CORE_ LIB,NDEBUG


    I do not know why this solved the problem. I am new to the Qt SDK. If someone can provide a more specific explanation, I would be happy to know.

    Oh, I almost forgot to mention, all this was done using QT 4.6.2, MVS 2008 and QwtPlot3D 0.2.7.

    I hope this works for anybody that face this same problem.

    Cheers!
    Vincent.

  7. #7
    Join Date
    Jun 2012
    Posts
    63
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: unresolved external symbol with qwt3d

    had the same problem and this solved it:

    DEFINES += QWT3D_DLL

Similar Threads

  1. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  2. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  3. Replies: 16
    Last Post: 23rd May 2008, 10:12
  4. link error for visual studio.net 2003
    By berlin in forum Newbie
    Replies: 9
    Last Post: 29th September 2006, 16:06
  5. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04

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.