multiply defined

21 Apr 2011

Hi mbed community,

I declared in one file the output variables like this:

DigitalOut L_ON_OFF( LED1 ); DigitalOut L_PLAY( LED2 ); DigitalOut L_NO_MEM( LED3 ); DigitalOut L_NO_SAT( LED4 );

I want to use them in another file, and I called them like this:

extern DigitalOut L_ON_OFF( LED1 ); extern DigitalOut L_PLAY( LED2 ); extern DigitalOut L_NO_MEM( LED3 ); extern DigitalOut L_NO_SAT( LED4 );

But the compiler gave me the error:

/media/uploads/affatatiej/error.jpg

Someone has an idea for a possible solution?

Thank you in advance.

21 Apr 2011

DigitalOut L_ON_OFF( LED1 ); 

But when using extern drop the parameters:-

extern DigitalOut L_ON_OFF; 
21 Apr 2011

Thank you Andy.

I changed my program, made the corrections you told me, and it worked perfectly.

Thanks a lot.