[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Heinz Haeberle" <Heinz.Haeberle@gmx.net>] (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["Heinz Haeberle" <Heinz.Haeberle@gmx.net>] (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Fri, 25 May 2001 13:58:44 +0200 (CEST)
>From owner-rtl Fri May 25 06:55:55 2001
Received: from mail.gmx.net (pop.gmx.net [194.221.183.20])
by hq.fsmlabs.com (8.11.2/8.11.2) with SMTP id f4PCtsP23795
for <rtl@fsmlabs.com>; Fri, 25 May 2001 06:55:54 -0600
Received: (qmail 15309 invoked by uid 0); 25 May 2001 12:50:48 -0000
Received: from invivocorp.airwire.net (HELO heinz) (209.114.215.18)
by mail.gmx.net (mp007-rz3) with SMTP; 25 May 2001 12:50:48 -0000
Message-ID: <024501c0e51a$16678f90$f000000a@domain>
Reply-To: "Heinz Haeberle" <Heinz.Haeberle@gmx.net>
From: "Heinz Haeberle" <Heinz.Haeberle@gmx.net>
To: <rtl@fsmlabs.com>, <rtl@rtlinux.org>
References: <F26QABZTW5k1Ed28kIN00002f30@hotmail.com>
Subject: Re: [rtl] RTLinux: C++ static members != good ?
Date: Fri, 25 May 2001 08:56:15 -0400
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
I sent an answer already. Got lost somehow.
Anyhow, the reason for this behavior is, that a static member is not just a
type definition, it is actually a real memory area. Therefor you have to
create a real variable therefore. I personally dont like that behavior, but
I think it was the only possible solution for C++. Again the reason is it
belongs to the class rather then to one of the objects.
What you have to add this to _one_ of the .cpp files:
int A::a;
or
int A::a=0;
if you want to initialize it
----- Original Message -----
From: "Evan Harvey" <poncholio@hotmail.com>
To: <rtl@rtlinux.org>
Sent: Wednesday, May 23, 2001 10:48 AM
Subject: [rtl] RTLinux: C++ static members != good ?
> I have modified the hello.cpp example that came with RTLinux. I moved
class
> A to a.h and then moved class B declarations to b.h and implementation to
> b.cpp.
>
> I can compile and run the modules no problem.
>
> my problem comes when I try to make
> int a; //from class A
> static int a;
>
> when I load the module I get an error like
>
> error in b.o : unresolved symbol _1A.a
>
> Any clue why this is? Can I not use static members with RTLinux? What is
> an alternative to static?
>
> Thank you for your help.
>
> -Evan
> poncholio@hotmail.com
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
>