hard to find the correct include files at compile time

"Ivaylo Ganchev" <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
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 ?

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 ?

Best regards,

--
Ivaylo Ganchev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.