troubleshooting Question

qt3 qt compile error VS6

Avatar of DaFou
DaFou asked on
C++Editors IDEs
5 Comments1 Solution960 ViewsLast Modified:
Coding some qt3 in VS6 but will not compile. I am trying to make a dialog.

#include "qdialog.h"

class QSalaryDialog : public QDialog  
{
      Q_OBJECT
public:
      QSalaryDialog(QWidget *parent = 0, const char *name = 0);
      virtual ~QSalaryDialog();
};

#include "stdafx.h"
#include "qapplication.h"
#include "qdialog.h"
#include "qsalarydialog.h"

int main(int argc, char* argv[])
{
      QApplication app(argc, argv);
      QSalaryDialog *dialog = new QSalaryDialog;
      app.setMainWidget(dialog);
      dialog->show();
      return app.exec();
}

Linking...
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QSalaryDialog::qt_property(int,int,class QVariant *)" (?qt_property@QSalaryDialog@@UAE_NHHPAVQVariant@@@Z)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QSalaryDialog::qt_emit(int,struct QUObject *)" (?qt_emit@QSalaryDialog@@UAE_NHPAUQUObject@@@Z)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QSalaryDialog::qt_invoke(int,struct QUObject *)" (?qt_invoke@QSalaryDialog@@UAE_NHPAUQUObject@@@Z)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QSalaryDialog::qt_cast(char const *)" (?qt_cast@QSalaryDialog@@UAEPAXPBD@Z)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall QSalaryDialog::className(void)const " (?className@QSalaryDialog@@UBEPBDXZ)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: static class QString __cdecl QSalaryDialog::tr(char const *,char const *)" (?tr@QSalaryDialog@@SA?AVQString@@PBD0@Z)
QSalaryDialog.obj : error LNK2001: unresolved external symbol "public: static class QMetaObject * __cdecl QSalaryDialog::staticMetaObject(void)" (?staticMetaObject@QSalaryDialog@@SAPAVQMetaObject@@XZ)
Debug/QSalary.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

QSalary.exe - 8 error(s), 0 warning(s)

object/library modules:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib winspool.lib winmm.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib

can someone explain why it gives the errors and how to solve it? Thanks in advance. :)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros