[ELDK] error: 'errno' undeclared

Stefano Babic sbabic at denx.de
Wed Sep 22 10:20:01 CEST 2010


Alberto Ciampini wrote:

Hi Alberto,

>>> i have a strange issue when cross compiling for arm: if i try to use
>>> errno (or build programs that uses it), i get (for example):
>>>
>>> cmem.c:116: error: 'errno' undeclared (first use in this function)
>>> cmem.c:116: error: (Each undeclared identifier is reported only once
>>> cmem.c:116: error: for each function it appears in.)
>>>      
>> I cannot confirm this issue, I can compile clean for ARM (you miss to
>> say which version of ELDK you are using. Let's say, we are using
>> ELDK-4.2).
>>    
> 
> sorry, i forgot that.... yes it's 4.2
> 
> $ more eldk/version
> ELDK version 4.2
> arm: Build 2008-11-24
> 
> 

Ok. Please do not drop the list as CC: to let other people to see the
results of the discussion.

>> The errno should be in the libc, and in the include path you find the
>> extern reference.
>>    
> 
> maybe the problem is that it doesn't find the extern reference??

However, I see in arm/usr/include/errno.h:

46 #ifndef errno
47 extern int errno;
48 #endif

If you do not set yourself errno with something like "#define errno
...", the reference should be find.

> hmm.... it doesn't compile either.... same error:
> 
> $ arm-linux-gcc -Wall -o testerrno testerrno.c
> testerrno.c: In function 'main':
> testerrno.c:17: error: 'errno' undeclared (first use in this function)
> testerrno.c:17: error: (Each undeclared identifier is reported only once
> testerrno.c:17: error: for each function it appears in.)

It seems your ELDK installation has problems. Have you tried with a
fresh installed ELDK ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the eldk mailing list