[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Shared varible between blocks

From: Vincenzo
Subject: Re: [Discuss-gnuradio] Shared varible between blocks
Date: Sun, 13 Apr 2008 10:56:06 +0200

Thanks Michael, it worked flawlessly

On Sat, 2008-04-12 at 20:28 -0400, Michael Dickens wrote:
> IIRC: The "standard C" way to do this is:
> In one, and only one, .cc file, do at the top level (not in any class,  
> method, or function definition), e.g.:
> int foo = 0;
> then in the .h file do:
> extern int foo;
> and you should be able to access 'foo' from any code the includes  
> that .h file.
> On Apr 12, 2008, at 7:32 PM, Vincenzo wrote:
> > I'm looking for suggestions on how to implement a variable that is
> > shared between two blocks.
> > If I include the same header into the .cc files implementing my blocks
> > I get the "multiple definition of variable x" error.
> >
> > Which is the correct way to do this?
> > is there an example available?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]