linking - QT app

H

hasadh

I am building an application over QT. I loaded my files to a VC++
console application project.
While trying to compile my classes, I got the following set for
expcetion for all QT related classes. has anybody faced the same
issue? Plz help me out


QT version: 3.2.3
OS : Windows 2000

Exception trace,
--------------------------------------------------------------
Linking...
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_property(int,int,class
QVariant *)" (?qt_property@AddViewDialog@@UAE_NHHPAVQVariant@@@Z)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_emit(int,struct QUObject *)"
(?qt_emit@AddViewDialog@@UAE_NHPAUQUObject@@@Z)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_invoke(int,struct QUObject
*)" (?qt_invoke@AddViewDialog@@UAE_NHPAUQUObject@@@Z)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual void * __thiscall AddViewDialog::qt_cast(char const *)"
(?qt_cast@AddViewDialog@@UAEPAXPBD@Z)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual char const * __thiscall AddViewDialog::className(void)const "
(?className@AddViewDialog@@UBEPBDXZ)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
static class QString __cdecl AddViewDialog::tr(char const *,char
const *)" (?tr@AddViewDialog@@SA?AVQString@@PBD0@Z)
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
static class QMetaObject * __cdecl
AddViewDialog::staticMetaObject(void)"
(?staticMetaObject@AddViewDialog@@SAPAVQMetaObject@@XZ)

....
 
V

Victor Bazarov

hasadh said:
I am building an application over QT. I loaded my files to a VC++
console application project.
While trying to compile my classes, I got the following set for
expcetion for all QT related classes. has anybody faced the same
issue? Plz help me out

Unresolved external errors usually appear due to one of two reasons:
either you used a library function/object but didn't supply the
library to the linker, or you declared a function yourself, used it,
and never defined it.

Which of the two situations is applicable in your case, I don't know.
Try contacting Qt online forum (on TrollTech's web site).
QT version: 3.2.3
OS : Windows 2000

Exception trace,
--------------------------------------------------------------
Linking...
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_property(int,int,class
QVariant *)" (?qt_property@AddViewDialog@@UAE_NHHPAVQVariant@@@Z)
[...]

V
 
H

hasadh

Thanks for your info. I have posted in QT forum.



Victor Bazarov said:
hasadh said:
I am building an application over QT. I loaded my files to a VC++
console application project.
While trying to compile my classes, I got the following set for
expcetion for all QT related classes. has anybody faced the same
issue? Plz help me out

Unresolved external errors usually appear due to one of two reasons:
either you used a library function/object but didn't supply the
library to the linker, or you declared a function yourself, used it,
and never defined it.

Which of the two situations is applicable in your case, I don't know.
Try contacting Qt online forum (on TrollTech's web site).
QT version: 3.2.3
OS : Windows 2000

Exception trace,
--------------------------------------------------------------
Linking...
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_property(int,int,class
QVariant *)" (?qt_property@AddViewDialog@@UAE_NHHPAVQVariant@@@Z)
[...]

V
 
D

Dave Townsend

This looks like you have not properly preprocessed your
C++ file, QT massages your raw C++ code and generates
further C++ code through the "moc" compiler. Any class you
derived from a QT-Object requires this step.
You cannot just load a bunch of C++ files into VC++ and
get it to work, you have to do something like:

qmake -project
qmake -tp vc ( generates a .dsp file for VC++)

where qmake is run in the directory of your sources. The first
step creates a QT-project, the second translate the ".pro" file
into a VC++ project which you can run. You will have to do
this every time you add new C++ files which define QT-widgets.
Or, figure out how to setup VC++ to do this.

dave

hasadh said:
Thanks for your info. I have posted in QT forum.



Victor Bazarov <[email protected]> wrote in message
hasadh said:
I am building an application over QT. I loaded my files to a VC++
console application project.
While trying to compile my classes, I got the following set for
expcetion for all QT related classes. has anybody faced the same
issue? Plz help me out

Unresolved external errors usually appear due to one of two reasons:
either you used a library function/object but didn't supply the
library to the linker, or you declared a function yourself, used it,
and never defined it.

Which of the two situations is applicable in your case, I don't know.
Try contacting Qt online forum (on TrollTech's web site).
QT version: 3.2.3
OS : Windows 2000

Exception trace,
--------------------------------------------------------------
Linking...
addviewdialog.obj : error LNK2001: unresolved external symbol "public:
virtual bool __thiscall AddViewDialog::qt_property(int,int,class
QVariant *)" (?qt_property@AddViewDialog@@UAE_NHHPAVQVariant@@@Z)
[...]

V
 
S

scoutchen

In QT you have to expand macros (e.g. Q_OBJECT) before
compiling/linking. Have a look at moc, the "meta object compiler".
Infos@Google: "qt moc".
 
V

Victor Bazarov

Dave said:
This looks like you have not properly preprocessed your
C++ file, QT massages your raw C++ code [...]

(a) Please don't top-post
(b) Please don't turn this C++ newsgroup into a Qt forum,
they have those at their web site

Thank you.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top