For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU.
This group is to exchange information to help users get started and learn how to use the devices.
Link problems with inline functions - nickcta - May 3 12:10:44 2008
I have just started to use ARM ( AT91SAM7S64/256 ) and successfully
build and loaded some simple examples (leds,interrupts...). I want now
to recompile the USB-CDC example on my platform, Eclipse+ GCC ARM
tool-chain.
I have a clean compile of the *.o files, but at link phase I have a
lot of "redeclaration errors" of the inline functions, which were
included in more then one .c file, because I included the
lib_AT91SAM7S64.h in more then one source files ,I guess.
The only solution I see is to collect all the inline functions in one
.c file and create a library object file and to define the functions
as "external inline
;" in the header file included in
each .c file where needed.
Am I doing the right thing or I am missing some important
information/knowledge here?
Thank you for your time.
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: Link problems with inline functions - Miroslav Kostadinov - May 3 13:01:26 2008
"external inline" sounds to me like external & internal at the same
time..
try "static inline" instead ;-)
--- On Sat, 5/3/08,
nickcta <c...@connic.net> wrote:
From: nickcta <c...@connic.net> Subject: [AT91SAM] Link problems with inline
functions To: A...@yahoogroups.com Date: Saturday, May 3, 2008, 5:45 PM
I have just started to use ARM ( AT91SAM7S64/ 256 ) and successfully
build and
loaded some simple examples (leds,interrupts. ..). I want now to recompile the
USB-CDC example on my platform, Eclipse+ GCC ARM tool-chain. I have a clean
compile of the *.o files, but at link phase I have a lot of "redeclaration errors" of
the inline functions, which were included in more then one .c file, because I included
the lib_AT91SAM7S64. h in more then one source files ,I guess. The only solution
I see is to collect all the inline functions in one .c file and create a library
object file and to define the functions as "external inline <function_name >;"
in the header file included in each .c file where needed. Am I doing the right
thing or I am missing some important information/ knowledge here? Thank you for
your time.
|
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.
Try it now.
__._,_.___
__,_._,___

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: Link problems with inline functions - nickcta - May 4 5:26:50 2008
I thought of that solution to 'multiple function definition error'
looking at the gcc online docs at:
http://gcc.gnu.org/onlinedocs/gcc/Inline.html
I initially thought the compiler should not complain ,at link time,
about multiple inline function definitions ,in different object
files, which in my vision should have act like a macro substitution
with type check. I was wrong, of course!
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )