Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, March 2002
AW: Linker error in VS 6.0


Message 1 in thread

If you built Qt as a DLL you need to specify QT_DLL within your preprocessor
definitions.

Tom

-----Ursprüngliche Nachricht-----
Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
Gesendet: Dienstag, 12. März 2002 12:21
An: QT Mailing List (E-Mail)
Betreff: Linker error in VS 6.0


Hello,

I have started a very small project in VS (main.cpp and about.h) as a
QT-project, but now if I try to compile I get this damn linker error:

Linking...
moc_aboutdialog.obj : error LNK2005: "public: __thiscall
CAboutDialog::CAboutDialog(class QWidget *,char const *,unsigned int)"
(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined in main.obj
Debug/About.exe : fatal error LNK1169: one or more multiply defined symbols
found
Error executing link.exe.

What can I do? Any helped is wanted...

Greetz
Björn

======================================
Björn Berg
Systemintegration, Open Source Development
GeNeSys GmbH & Co. KG
Müller-Breslau-Str. 30a
45130 Essen, Germany

Fon: +49 201 8954 5420
Email: berg@genesys-e.de
====================================== 

--
 [ signature omitted ] 

Message 2 in thread

This is done... But it does not help... :-(


> -----Ursprüngliche Nachricht-----
> Von: Bauer Thomas [mailto:Thomas.Bauer@fh-joanneum.at]
> Gesendet: Dienstag, 12. März 2002 13:12
> An: 'qt-interest@trolltech.com'
> Betreff: AW: Linker error in VS 6.0
> 
> 
> If you built Qt as a DLL you need to specify QT_DLL within 
> your preprocessor
> definitions.
> 
> Tom
> 
> -----Ursprüngliche Nachricht-----
> Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
> Gesendet: Dienstag, 12. März 2002 12:21
> An: QT Mailing List (E-Mail)
> Betreff: Linker error in VS 6.0
> 
> 
> Hello,
> 
> I have started a very small project in VS (main.cpp and about.h) as a
> QT-project, but now if I try to compile I get this damn linker error:
> 
> Linking...
> moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> CAboutDialog::CAboutDialog(class QWidget *,char const *,unsigned int)"
> (??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined in main.obj
> Debug/About.exe : fatal error LNK1169: one or more multiply 
> defined symbols
> found
> Error executing link.exe.
> 
> What can I do? Any helped is wanted...
> 
> Greetz
> Björn
> 
> ======================================
> Björn Berg
> Systemintegration, Open Source Development
> GeNeSys GmbH & Co. KG
> Müller-Breslau-Str. 30a
> 45130 Essen, Germany
> 
> Fon: +49 201 8954 5420
> Email: berg@genesys-e.de
> ====================================== 
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 


Message 3 in thread

Is the Intel C++ Linker for free or do I have to spent extra money for it??
Also I think, that changing the Compiler and Linker would not help to solute
the problem with MS VC++. And I want to solve THIS problem...

Björn

> -----Ursprüngliche Nachricht-----
> Von: John Dean [mailto:john@rygannon.com]
> Gesendet: Dienstag, 12. März 2002 13:37
> An: BERG@genesys-e.de; QT Mailing List (E-Mail)
> Betreff: Re: Linker error in VS 6.0
> 
> 
> Hi
> The MS linker is not smart enough to handle duplicate 
> symbols. My solution 
> was to get a better compiler and linker - Intel C++ for Windows
> 
> At 12:20 12/03/2002 +0100, Berg, Björn wrote:
> >Hello,
> >
> >I have started a very small project in VS (main.cpp and about.h) as a
> >QT-project, but now if I try to compile I get this damn linker error:
> >
> >Linking...
> >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> >CAboutDialog::CAboutDialog(class QWidget *,char const 
> *,unsigned int)"
> >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined in main.obj
> >Debug/About.exe : fatal error LNK1169: one or more multiply 
> defined symbols
> >found
> >Error executing link.exe.
> >
> >What can I do? Any helped is wanted...
> >
> >Greetz
> >Björn
> >
> >======================================
> >Björn Berg
> >Systemintegration, Open Source Development
> >GeNeSys GmbH & Co. KG
> >Müller-Breslau-Str. 30a
> >45130 Essen, Germany
> >
> >Fon: +49 201 8954 5420
> >Email: berg@genesys-e.de
> >======================================
> >
> >--
> >List archive and information: http://qt-interest.trolltech.com
> 
> Regards
> John,
> 
> -----
> john@theKompany.com
> http://www.theKompany.com
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 


Message 4 in thread

I know I had this problem, too... and I solved it but I can't seem to
remember the solution... it was something very obvious (afterwards ;-)

Tom


-----Ursprüngliche Nachricht-----
Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
Gesendet: Dienstag, 12. März 2002 15:22
An: 'john@rygannon.com'; QT Mailing List (E-Mail)
Betreff: AW: Linker error in VS 6.0


Is the Intel C++ Linker for free or do I have to spent extra money for it??
Also I think, that changing the Compiler and Linker would not help to solute
the problem with MS VC++. And I want to solve THIS problem...

Björn

> -----Ursprüngliche Nachricht-----
> Von: John Dean [mailto:john@rygannon.com]
> Gesendet: Dienstag, 12. März 2002 13:37
> An: BERG@genesys-e.de; QT Mailing List (E-Mail)
> Betreff: Re: Linker error in VS 6.0
> 
> 
> Hi
> The MS linker is not smart enough to handle duplicate 
> symbols. My solution 
> was to get a better compiler and linker - Intel C++ for Windows
> 
> At 12:20 12/03/2002 +0100, Berg, Björn wrote:
> >Hello,
> >
> >I have started a very small project in VS (main.cpp and about.h) as a
> >QT-project, but now if I try to compile I get this damn linker error:
> >
> >Linking...
> >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> >CAboutDialog::CAboutDialog(class QWidget *,char const 
> *,unsigned int)"
> >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined in main.obj
> >Debug/About.exe : fatal error LNK1169: one or more multiply 
> defined symbols
> >found
> >Error executing link.exe.
> >
> >What can I do? Any helped is wanted...
> >
> >Greetz
> >Björn
> >
> >======================================
> >Björn Berg
> >Systemintegration, Open Source Development
> >GeNeSys GmbH & Co. KG
> >Müller-Breslau-Str. 30a
> >45130 Essen, Germany
> >
> >Fon: +49 201 8954 5420
> >Email: berg@genesys-e.de
> >======================================
> >
> >--
> >List archive and information: http://qt-interest.trolltech.com
> 
> Regards
> John,
> 
> -----
> john@theKompany.com
> http://www.theKompany.com
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 

--
 [ signature omitted ] 

Message 5 in thread

Maybe something in the project or workspace settings?

Björn

> -----Ursprüngliche Nachricht-----
> Von: Bauer Thomas [mailto:Thomas.Bauer@fh-joanneum.at]
> Gesendet: Dienstag, 12. März 2002 15:26
> An: 'BERG@genesys-e.de'; 'john@rygannon.com'; QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> I know I had this problem, too... and I solved it but I can't seem to
> remember the solution... it was something very obvious (afterwards ;-)
> 
> Tom
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
> Gesendet: Dienstag, 12. März 2002 15:22
> An: 'john@rygannon.com'; QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> Is the Intel C++ Linker for free or do I have to spent extra 
> money for it??
> Also I think, that changing the Compiler and Linker would not 
> help to solute
> the problem with MS VC++. And I want to solve THIS problem...
> 
> Björn
> 
> > -----Ursprüngliche Nachricht-----
> > Von: John Dean [mailto:john@rygannon.com]
> > Gesendet: Dienstag, 12. März 2002 13:37
> > An: BERG@genesys-e.de; QT Mailing List (E-Mail)
> > Betreff: Re: Linker error in VS 6.0
> > 
> > 
> > Hi
> > The MS linker is not smart enough to handle duplicate 
> > symbols. My solution 
> > was to get a better compiler and linker - Intel C++ for Windows
> > 
> > At 12:20 12/03/2002 +0100, Berg, Björn wrote:
> > >Hello,
> > >
> > >I have started a very small project in VS (main.cpp and 
> about.h) as a
> > >QT-project, but now if I try to compile I get this damn 
> linker error:
> > >
> > >Linking...
> > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > *,unsigned int)"
> > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> in main.obj
> > >Debug/About.exe : fatal error LNK1169: one or more multiply 
> > defined symbols
> > >found
> > >Error executing link.exe.
> > >
> > >What can I do? Any helped is wanted...
> > >
> > >Greetz
> > >Björn
> > >
> > >======================================
> > >Björn Berg
> > >Systemintegration, Open Source Development
> > >GeNeSys GmbH & Co. KG
> > >Müller-Breslau-Str. 30a
> > >45130 Essen, Germany
> > >
> > >Fon: +49 201 8954 5420
> > >Email: berg@genesys-e.de
> > >======================================
> > >
> > >--
> > >List archive and information: http://qt-interest.trolltech.com
> > 
> > Regards
> > John,
> > 
> > -----
> > john@theKompany.com
> > http://www.theKompany.com
> > 
> > --
> > List archive and information: http://qt-interest.trolltech.com
> > 
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 


Message 6 in thread

Are you perhaps including "moc_aboutdialog.cpp" in main.cpp?

BTW: I would be very cautious with linkers that accept duplicate
defined symbols. They are not supposed to, unless the programmer
allows it using the respective linker option.

- Soeren


> > > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > > *,unsigned int)"
> > > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> > in main.obj
> > > >Debug/About.exe : fatal error LNK1169: one or more multiply 


Message 7 in thread

Did you specify   /subsystem:windows  in  'project->project
settings->link->general->project options'.
I seem that I had to do this manually.

Tom

-----Ursprüngliche Nachricht-----
Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
Gesendet: Dienstag, 12. März 2002 15:32
An: QT Mailing List (E-Mail)
Betreff: AW: Linker error in VS 6.0


Maybe something in the project or workspace settings?

Björn

> -----Ursprüngliche Nachricht-----
> Von: Bauer Thomas [mailto:Thomas.Bauer@fh-joanneum.at]
> Gesendet: Dienstag, 12. März 2002 15:26
> An: 'BERG@genesys-e.de'; 'john@rygannon.com'; QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> I know I had this problem, too... and I solved it but I can't seem to
> remember the solution... it was something very obvious (afterwards ;-)
> 
> Tom
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
> Gesendet: Dienstag, 12. März 2002 15:22
> An: 'john@rygannon.com'; QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> Is the Intel C++ Linker for free or do I have to spent extra 
> money for it??
> Also I think, that changing the Compiler and Linker would not 
> help to solute
> the problem with MS VC++. And I want to solve THIS problem...
> 
> Björn
> 
> > -----Ursprüngliche Nachricht-----
> > Von: John Dean [mailto:john@rygannon.com]
> > Gesendet: Dienstag, 12. März 2002 13:37
> > An: BERG@genesys-e.de; QT Mailing List (E-Mail)
> > Betreff: Re: Linker error in VS 6.0
> > 
> > 
> > Hi
> > The MS linker is not smart enough to handle duplicate 
> > symbols. My solution 
> > was to get a better compiler and linker - Intel C++ for Windows
> > 
> > At 12:20 12/03/2002 +0100, Berg, Björn wrote:
> > >Hello,
> > >
> > >I have started a very small project in VS (main.cpp and 
> about.h) as a
> > >QT-project, but now if I try to compile I get this damn 
> linker error:
> > >
> > >Linking...
> > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > *,unsigned int)"
> > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> in main.obj
> > >Debug/About.exe : fatal error LNK1169: one or more multiply 
> > defined symbols
> > >found
> > >Error executing link.exe.
> > >
> > >What can I do? Any helped is wanted...
> > >
> > >Greetz
> > >Björn
> > >
> > >======================================
> > >Björn Berg
> > >Systemintegration, Open Source Development
> > >GeNeSys GmbH & Co. KG
> > >Müller-Breslau-Str. 30a
> > >45130 Essen, Germany
> > >
> > >Fon: +49 201 8954 5420
> > >Email: berg@genesys-e.de
> > >======================================
> > >
> > >--
> > >List archive and information: http://qt-interest.trolltech.com
> > 
> > Regards
> > John,
> > 
> > -----
> > john@theKompany.com
> > http://www.theKompany.com
> > 
> > --
> > List archive and information: http://qt-interest.trolltech.com
> > 
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 

--
 [ signature omitted ] 

Message 8 in thread

No, this was automatically done...


> -----Ursprüngliche Nachricht-----
> Von: Bauer Thomas [mailto:Thomas.Bauer@fh-joanneum.at]
> Gesendet: Dienstag, 12. März 2002 15:39
> An: 'BERG@genesys-e.de'; QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> Did you specify   /subsystem:windows  in  'project->project
> settings->link->general->project options'.
> I seem that I had to do this manually.
> 
> Tom
> 
> -----Ursprüngliche Nachricht-----
> Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
> Gesendet: Dienstag, 12. März 2002 15:32
> An: QT Mailing List (E-Mail)
> Betreff: AW: Linker error in VS 6.0
> 
> 
> Maybe something in the project or workspace settings?
> 
> Björn
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Bauer Thomas [mailto:Thomas.Bauer@fh-joanneum.at]
> > Gesendet: Dienstag, 12. März 2002 15:26
> > An: 'BERG@genesys-e.de'; 'john@rygannon.com'; QT Mailing 
> List (E-Mail)
> > Betreff: AW: Linker error in VS 6.0
> > 
> > 
> > I know I had this problem, too... and I solved it but I 
> can't seem to
> > remember the solution... it was something very obvious 
> (afterwards ;-)
> > 
> > Tom
> > 
> > 
> > -----Ursprüngliche Nachricht-----
> > Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
> > Gesendet: Dienstag, 12. März 2002 15:22
> > An: 'john@rygannon.com'; QT Mailing List (E-Mail)
> > Betreff: AW: Linker error in VS 6.0
> > 
> > 
> > Is the Intel C++ Linker for free or do I have to spent extra 
> > money for it??
> > Also I think, that changing the Compiler and Linker would not 
> > help to solute
> > the problem with MS VC++. And I want to solve THIS problem...
> > 
> > Björn
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: John Dean [mailto:john@rygannon.com]
> > > Gesendet: Dienstag, 12. März 2002 13:37
> > > An: BERG@genesys-e.de; QT Mailing List (E-Mail)
> > > Betreff: Re: Linker error in VS 6.0
> > > 
> > > 
> > > Hi
> > > The MS linker is not smart enough to handle duplicate 
> > > symbols. My solution 
> > > was to get a better compiler and linker - Intel C++ for Windows
> > > 
> > > At 12:20 12/03/2002 +0100, Berg, Björn wrote:
> > > >Hello,
> > > >
> > > >I have started a very small project in VS (main.cpp and 
> > about.h) as a
> > > >QT-project, but now if I try to compile I get this damn 
> > linker error:
> > > >
> > > >Linking...
> > > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > > *,unsigned int)"
> > > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> > in main.obj
> > > >Debug/About.exe : fatal error LNK1169: one or more multiply 
> > > defined symbols
> > > >found
> > > >Error executing link.exe.
> > > >
> > > >What can I do? Any helped is wanted...
> > > >
> > > >Greetz
> > > >Björn
> > > >
> > > >======================================
> > > >Björn Berg
> > > >Systemintegration, Open Source Development
> > > >GeNeSys GmbH & Co. KG
> > > >Müller-Breslau-Str. 30a
> > > >45130 Essen, Germany
> > > >
> > > >Fon: +49 201 8954 5420
> > > >Email: berg@genesys-e.de
> > > >======================================
> > > >
> > > >--
> > > >List archive and information: http://qt-interest.trolltech.com
> > > 
> > > Regards
> > > John,
> > > 
> > > -----
> > > john@theKompany.com
> > > http://www.theKompany.com
> > > 
> > > --
> > > List archive and information: http://qt-interest.trolltech.com
> > > 
> > 
> > --
> > List archive and information: http://qt-interest.trolltech.com
> > 
> > --
> > List archive and information: http://qt-interest.trolltech.com
> > 
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 


Message 9 in thread

No, I do not include "moc_aboutdialog.cpp" in main.cpp... Is this
necessary??

Björn

> -----Ursprüngliche Nachricht-----
> Von: Soeren.Fietzke@t-online.de [mailto:Soeren.Fietzke@t-online.de]
> Gesendet: Dienstag, 12. März 2002 15:41
> An: BERG@genesys-e.de; Qt Interest List
> Betreff: Re: Linker error in VS 6.0
> 
> 
> Are you perhaps including "moc_aboutdialog.cpp" in main.cpp?
> 
> BTW: I would be very cautious with linkers that accept duplicate
> defined symbols. They are not supposed to, unless the programmer
> allows it using the respective linker option.
> 
> - Soeren
> 
> 
> > > > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > > > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > > > *,unsigned int)"
> > > > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> > > in main.obj
> > > > >Debug/About.exe : fatal error LNK1169: one or more multiply 
> 
> 


Message 10 in thread

No, no, don't do that :-)
On second thought, the constructor of CAboutDialog should not appear in the moc file at all.
If the code is not too long, perhaps just post it?

- Soeren


----- Original Message -----
From: "Berg, Björn" <BERG@genesys-e.de>
To: <Soeren.Fietzke@t-online.de>; "QT Mailing List (E-Mail)" <qt-interest@trolltech.com>
Sent: Tuesday, March 12, 2002 3:50 PM
Subject: AW: Linker error in VS 6.0


No, I do not include "moc_aboutdialog.cpp" in main.cpp... Is this
necessary??

Björn


Message 11 in thread

Nah... I never included any MOC file in any Qt project.

Tom 

-----Ursprüngliche Nachricht-----
Von: "Berg, Björn" [mailto:BERG@genesys-e.de]
Gesendet: Dienstag, 12. März 2002 15:51
An: 'Soeren.Fietzke@t-online.de'; QT Mailing List (E-Mail)
Betreff: AW: Linker error in VS 6.0


No, I do not include "moc_aboutdialog.cpp" in main.cpp... Is this
necessary??

Björn

> -----Ursprüngliche Nachricht-----
> Von: Soeren.Fietzke@t-online.de [mailto:Soeren.Fietzke@t-online.de]
> Gesendet: Dienstag, 12. März 2002 15:41
> An: BERG@genesys-e.de; Qt Interest List
> Betreff: Re: Linker error in VS 6.0
> 
> 
> Are you perhaps including "moc_aboutdialog.cpp" in main.cpp?
> 
> BTW: I would be very cautious with linkers that accept duplicate
> defined symbols. They are not supposed to, unless the programmer
> allows it using the respective linker option.
> 
> - Soeren
> 
> 
> > > > >moc_aboutdialog.obj : error LNK2005: "public: __thiscall
> > > > >CAboutDialog::CAboutDialog(class QWidget *,char const 
> > > > *,unsigned int)"
> > > > >(??0CAboutDialog@@QAE@PAVQWidget@@PBDI@Z) already defined 
> > > in main.obj
> > > > >Debug/About.exe : fatal error LNK1169: one or more multiply 
> 
> 

--
 [ signature omitted ]