0

When compiling Atmel example with arm cross-compiler getting :

../at91lib/utility/stdio.c:64:8: error: variable 'r' has initializer but incomplete type

the code is :

struct _reent r = {0, (FILE *) 0, (FILE *) 1, (FILE *) 0};

I don't know what can I do here since first I need here is to understand what this code must mean?

And then can I re code it for my compiler? Or must I downgrade compiler to some other version?

My version : arm-unknown-linux-uclibcgnueabi-gcc (Buildroot 2012.05-git-00423-g4205dbd) 4.5.3

cnd
  • 32,616
  • 62
  • 183
  • 313
  • possible duplicate of [What is this style of syntax in C?](http://stackoverflow.com/questions/10071304/what-is-this-style-of-syntax-in-c) – Alok Save May 10 '12 at 06:27
  • 1
    I would guess that `struct _reent` hasn't been defined anywhere, and that's what the compiler's complainging about. – Philip Potter May 10 '12 at 06:27
  • @Als that's a related but distinct question. That question asks about the initializer. This one asks about the error message. – Philip Potter May 10 '12 at 06:28
  • 1
    Take a look at this thread: http://www.at91.com/forum/viewtopic.php/f,8/t,5352/ – MByD May 10 '12 at 06:29
  • "had to use Sourcery G++ Lite 2008q3-39 for ARM EABI from ... release567 Anything newer or older gave (different) errors." weird weird weird very weird! – cnd May 10 '12 at 06:31
  • @Binyamin Sharet I'm not sure what is better put your comment on answer or just remove this question? – cnd May 10 '12 at 06:47
  • @Alessa - I posted it as answer for future reference. – MByD May 10 '12 at 06:52

1 Answers1

1

From the AT91SAM community:

It looks like you have to use exactly the right version of compiler: To get sam-ba applets to compile under linux you have to use Sourcery G++ Lite 2008q3-39 for ARM EABI from http://www.codesourcery.com/sgpp/lite/arm/portal/release567 Anything newer or older gives (different) errors.

MByD
  • 135,866
  • 28
  • 264
  • 277