avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] hard to find the correct include files at compile tim


From: Senthil Kumar Selvaraj
Subject: Re: [avr-gcc-list] hard to find the correct include files at compile time
Date: Wed, 26 Nov 2014 10:50:12 +0530
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Nov 25, 2014 at 02:57:31PM +0100, Ivaylo Ganchev wrote:
> Hello,
> 
> I have a strange behavior while compiling an avr project with code-blocks.
> In my code I include the <avr/pgmspace.h>. The file is situated in
> /usr/lib/avr/include/avr/pgmspace.h
> 
> The pgmspace.h includes <inttypes.h>. The problem is that at compile time
> the wrong inttypes.h is included -- the one which is part of the x86
> architecture. I am forced to make an explicit statement (#include
> "/usr/lib/avr/include/inttypes.h") to solve the issue.
> 
> Is it a normal behavior ? Should I set a compile-time variables in
> code-blocks so that the correct file is included ?

No. This is what I'm seeing

 ~/avr/install/bin/avr-gcc -v inc.c
<snip>
#include "..." search starts here:
#include <...> search starts here:
 /home/saaadhu/avr/install/lib/gcc/avr/5.0.0/include
 /home/saaadhu/avr/install/lib/gcc/avr/5.0.0/include-fixed
 /home/saaadhu/avr/install/lib/gcc/avr/5.0.0/../../../../avr/sys-include
 /home/saaadhu/avr/install/lib/gcc/avr/5.0.0/../../../../avr/include
End of search list.

Can you paste yours? What version of the toolchain are you using? Did you build
it, did it come from your distribution, or is it Atmel's?

> 
> As a side-note the pgmspace.h includes also <stddef.h>. I am not sure
> whether the correct one is charged. To be sure I also make an explicit
> statement (#include "/usr/lib/gcc/avr/4.7.2/include/stddef.h"). What is
> more strange is that both files are not in the same part of the directory
> tree. Is there a logic behind it that I cannot understand ?

stddef.h comes from the compiler (gcc), whereas inttypes.h is from 
avr-libc - hence the different prefix paths.

Regards
Senthil



reply via email to

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