By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,411 Members | 981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,411 IT Pros & Developers. It's quick & easy.

linking - QT app

P: n/a
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)

....
--------------------------------------------------------------

thanks,
prak
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
hasadh wrote:
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
Jul 22 '05 #2

P: n/a
Thanks for your info. I have posted in QT forum.

Victor Bazarov <v.********@comAcast.net> wrote in message news:<TW***************@newsread1.dllstx09.us.to.v erio.net>...
hasadh wrote:
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

Jul 22 '05 #3

P: n/a
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" <h_****@hotmail.com> wrote in message
news:7b**************************@posting.google.c om...
Thanks for your info. I have posted in QT forum.

Victor Bazarov <v.********@comAcast.net> wrote in message

news:<TW***************@newsread1.dllstx09.us.to.v erio.net>...
hasadh wrote:
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

Jul 22 '05 #4

P: n/a
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".
Jul 22 '05 #5

P: n/a
Dave Townsend wrote:
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
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.