[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Qt LNK2001 errors

Asked by amaharaja in C++ Programming Language, QT Programming Language

Tags: external, unresolved, symbol, qt, lnk2001

I am trying to compile a Qt example about popup widget (http://doc.trolltech.com/3.3/popup-example.html), but get some LNK2001 errors (see below).  I use .NET 2003 integrated compiler and have added the moc step to my header file.  

-----------------------------------------------------------------------------
Header file:

#ifndef TEST_POPUP_H_
#define TEST_POPUP_H_

#include <QtWidgets/common.h>

#include <qwidget.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlineedit.h>

class TIQTPLUGINS_DECL TestPopup : public QLabel {

      Q_OBJECT

public:
    TestPopup( QWidget* parent = 0, const char* name = 0 );
    void popup( QWidget* parent = 0);

protected:
    virtual void mouseMoveEvent( QMouseEvent * );
    virtual void mouseReleaseEvent( QMouseEvent * );
    virtual void closeEvent( QCloseEvent * );

private:
    QWidget* popupParent;
    int moves;

};

 class TIQTPLUGINS_DECL Frame : public QFrame
 {
     Q_OBJECT

 public:
     Frame( QWidget *parent=0, const char*  name = 0 );

 protected:

 private slots:
     void button1Clicked();
     void button2Pressed();

 private:
     QPushButton *button1;
     QPushButton *button2;

     QFrame* popup1;
     TestPopup* popup2;
 };

#endif
------------------------------------------------------------------------------------
Link errors:

------ Rebuild All started: Project: TiWidgets, Configuration: Debug Win32 ------

Deleting intermediate files and output files for project 'TiWidgets', configuration 'Debug|Win32'.
Moc'ing test_popup.h...
Moc'ing distribution_selector.h...
Compiling...
moc_distribution_selector.cpp
Compiling...
test_popup.cpp
Compiling...
ti_widgets_plugin.cpp
ti_widgets_plugin.cpp(25) : warning C4100: 'key' : unreferenced formal parameter
ti_widgets_plugin.cpp(35) : warning C4100: 'key' : unreferenced formal parameter
ti_widgets_plugin.cpp(54) : warning C4100: 'key' : unreferenced formal parameter
Compiling...
ti_qtAccessors.cpp
c:\GsTL\GsTLAppli\GsTLAppli\gui\utils\qwidget_value_accessor.h(53) : warning C4100: 'widget' : unreferenced formal parameter
c:\GsTL\GsTLAppli\GsTLAppli\utils\gstl_messages_private.h(206) : warning C4251: 'Channel::scribes_' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'Channel'
        with
        [
            _Ty=SmartPtr<Scribe>
        ]
Compiling...
distribution_selector.cpp
Linking...
   Creating library c:\gstl\GsTLAppli\lib\win32\debug\TiWidgets.lib and object c:\gstl\GsTLAppli\lib\win32\debug\TiWidgets.exp
test_popup1.obj : error LNK2019: unresolved external symbol "public: static class QMetaObject * __cdecl TestPopup::staticMetaObject(void)" (?staticMetaObject@TestPopup@@SAPAVQMetaObject@@XZ) referenced in function "public: virtual class QMetaObject * __thiscall TestPopup::metaObject(void)const " (?metaObject@TestPopup@@UBEPAVQMetaObject@@XZ)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TestPopup::qt_property(int,int,class QVariant *)" (?qt_property@TestPopup@@UAE_NHHPAVQVariant@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TestPopup::qt_emit(int,struct QUObject *)" (?qt_emit@TestPopup@@UAE_NHPAUQUObject@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TestPopup::qt_invoke(int,struct QUObject *)" (?qt_invoke@TestPopup@@UAE_NHPAUQUObject@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall TestPopup::qt_cast(char const *)" (?qt_cast@TestPopup@@UAEPAXPBD@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TestPopup::className(void)const " (?className@TestPopup@@UBEPBDXZ)
test_popup1.obj : error LNK2019: unresolved external symbol "public: static class QMetaObject * __cdecl Frame::staticMetaObject(void)" (?staticMetaObject@Frame@@SAPAVQMetaObject@@XZ) referenced in function "public: virtual class QMetaObject * __thiscall Frame::metaObject(void)const " (?metaObject@Frame@@UBEPAVQMetaObject@@XZ)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Frame::qt_property(int,int,class QVariant *)" (?qt_property@Frame@@UAE_NHHPAVQVariant@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Frame::qt_emit(int,struct QUObject *)" (?qt_emit@Frame@@UAE_NHPAUQUObject@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Frame::qt_invoke(int,struct QUObject *)" (?qt_invoke@Frame@@UAE_NHPAUQUObject@@@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall Frame::qt_cast(char const *)" (?qt_cast@Frame@@UAEPAXPBD@Z)
test_popup1.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall Frame::className(void)const " (?className@Frame@@UBEPBDXZ)
c:\gstl\GsTLAppli\lib\win32\debug\TiWidgets.dll : fatal error LNK1120: 12 unresolved externals

Build log was saved at "file://c:\GsTL\Ti_Program\QtWidgets\Debug\BuildLog.htm"
TiWidgets - 13 error(s), 5 warning(s)


---------------------- Done ----------------------

    Rebuild All: 0 succeeded, 1 failed, 0 skipped

------------------------------------------------------

Appreciate your help.
[+][-]09/06/06 09:36 PM, ID: 17468253Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/06/06 09:55 PM, ID: 17468299Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/06/06 09:58 PM, ID: 17468303Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/06/06 10:01 PM, ID: 17468309Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/06/06 10:02 PM, ID: 17468312Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: C++ Programming Language, QT Programming Language
Tags: external, unresolved, symbol, qt, lnk2001
Sign Up Now!
Solution Provided By: rajeev_devin
Participating Experts: 2
Solution Grade: B
 
[+][-]09/07/06 04:59 PM, ID: 17476023Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/07/06 07:29 PM, ID: 17476544Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/07/06 10:22 PM, ID: 17477137Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89