[Qt-interest] duplicate symbol
"Alexander Carôt"
alexander_carot at gmx.net
Fri Oct 1 11:37:22 CEST 2010
Thanks to Paul and Tiago !
allright, I will think it over and see where the actual problem is. In fact my app has become pretty complex over the years so that it might take a while. Once it is fixed or further questions come up I will get back.
Thanks again,
best
-- A l e x
-------- Original-Nachricht --------
> Datum: Fri, 1 Oct 2010 10:35:42 +0200 (CEST)
> Von: paulf at free.fr
> An: qt-interest at trolltech.com
> Betreff: Re: [Qt-interest] duplicate symbol
> Hi
>
> More precisely, it is defined in more than one compilation unit. Normally,
> a compilation unit is the .cpp file plus all of the headers that it
> includes. So in addition to the possibility that the symbol is multiply defined
> in .cpp files, it could also be defined just once in a header that is itself
> included in more than one .cpp file. The result is that the symbol is
> multiply defined in more than one compilation unit.
>
> Golden rule:
> headers -> declarations
> .cpp -> definitions
>
> (with exceptions for inline functions (use sparingly) and templates)
>
> A+
> Paul
>
>
> ----- Original Message -----
> From: "Thiago Macieira" <thiago at kde.org>
> To: qt-interest at trolltech.com
> Sent: Friday, 1 October, 2010 10:27:11 GMT +01:00 Amsterdam / Berlin /
> Bern / Rome / Stockholm / Vienna
> Subject: Re: [Qt-interest] duplicate symbol
>
> Em Sexta-feira 01 Outubro 2010, às 09:27:55, Alexander Carôt escreveu:
> > > On Friday 1. October 2010 09.00.15 Alexander Carôt wrote:
> > > > ld: duplicate symbol myWidget::event(QEvent*) in soundjack.o and
> main.o
> > > >
> > > > How can I fix this ?
> > >
> > > You declared the same function in both .cpp. Remove from one.
> >
> > I just did that but then I noticed that the problem is obviously not
> > related to the event loop: I totally deleted the function and then got
> the
> > same error in context with the constructor:
> >
> > ld: duplicate symbol myWidget::myWidget()in soundjack.o and main.o
> >
> > Do you have any further hint or is more info required ?
>
> It's the same hint: the symbol is defined in more than one .cpp.
>
> Note that all the #includes count as part of the .cpp.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Senior Product Manager - Nokia, Qt Development Frameworks
> PGP/GPG: 0x6EF45358; fingerprint:
> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
> Qt Developer Days 2010 - Munich Oct 11-13 - San Francisco Nov 1-3
> For more information and to register: http://qt.nokia.com/qtdevdays2010
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
--
http://www.carot.de
http://www.triologue.de
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
More information about the Qt-interest-old
mailing list