Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > linking - QT app

Reply
Thread Tools

linking - QT app

 
 
hasadh
Guest
Posts: n/a
 
      08-04-2004
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
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      08-04-2004
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
 
Reply With Quote
 
 
 
 
hasadh
Guest
Posts: n/a
 
      08-05-2004
Thanks for your info. I have posted in QT forum.



Victor Bazarov <> wrote in message news:<TW6Qc.437$ 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

 
Reply With Quote
 
Dave Townsend
Guest
Posts: n/a
 
      08-05-2004
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" <> wrote in message
news: om...
> Thanks for your info. I have posted in QT forum.
>
>
>
> Victor Bazarov <> wrote in message

news:<TW6Qc.437$ 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



 
Reply With Quote
 
scoutchen
Guest
Posts: n/a
 
      08-05-2004
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".
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      08-05-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the easiest way to convert a .net windows app to web app? tom ASP .Net 4 10-24-2008 05:57 PM
win app and web app mimi ASP .Net 1 07-29-2004 03:19 AM
Asp.net app, Unable to load dll!!, while same dll loads properly in Win form app NGM ASP .Net 0 11-06-2003 10:34 AM
problems while linking in MFc app rama C++ 3 09-05-2003 11:52 AM
Problem Linking Simple App Brian J. Ackermann C++ 1 07-28-2003 05:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57