17

I'm trying to use Chibios. The example code they provide seems to need stdint.h file. The Makefile gives the following error:

/usr/lib/gcc/arm-none-eabi/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.
../../os/ports/GCC/ARMCMx/rules.mk:182: recipe for target 'build/obj/crt0.o' failed
make: *** [build/obj/crt0.o] Error 1

I could find nothing useful in the web.

Lundin
  • 195,001
  • 40
  • 254
  • 396
ceremcem
  • 3,900
  • 4
  • 28
  • 66
  • `#include_next` is non-standard. Why did you try to use it rather than `#include`? – Keith Thompson May 31 '14 at 23:00
  • 1
    I have nothing to do with that statement. #include_next is placed in /usr/lib/gcc/arm-none-eabi/4.8/include/stdint.h which is shipped with arm-none-eabi-gcc package. Do you want me to edit that file? – ceremcem Jun 01 '14 at 01:18
  • Sorry, I didn't notice that. No, I wouldn't suggest editing that file. I don't know why it would use `#include_next` – Keith Thompson Jun 01 '14 at 01:50

4 Answers4

26

#include_next is used to let one file augment another one with the same name. In this case, it seems the "other one" is not available.

I got the same error trying to compile my code using the gcc-arm package in Linux Mint, gcc-arm-none-eabi. I got past this problem by installing libnewlib-arm-none-eabi: sudo apt-get install libnewlib-arm-none-eabi

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Phil Hord
  • 12,780
  • 1
  • 26
  • 30
7

try this:

apt-get install avr-libc

Hmm, my answer is not suit for ARM, just wish other avr users can get help when they meet the same question.

gzerone
  • 2,179
  • 21
  • 24
  • How will that help? The target is clearly ARM / STM32, not AVR. – Clifford Dec 14 '18 at 07:47
  • The question is no stdint.h, and I just googled which avr-libc included. It works on my teensy project. – gzerone Dec 15 '18 at 06:00
  • But stdint.h is architecture specific, and that for an 8 bit AVR is of not fit for use with a 32 bit ARM. The question is clearly tagged, and the body text clearly indicates the toolchain in use. The solution here is to correctly install the correct toolchain, and this isn't it. – Clifford Dec 15 '18 at 08:26
  • @Clifford, thx for your correction. I just find stdint.h here: https://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html. You can compare with arm one. – gzerone Dec 16 '18 at 12:30
3

Probably you forgot to specify -ffreestanding option of gcc.

Sauron
  • 404
  • 3
  • 14
2

With valuable helps of gcc-arm-embedded team (here) I managed to compile Chibios demo program successfully. I downloaded gcc-arm-none-eabi-4_8-2014q1 from their launchpad site and it worked just fine.

ceremcem
  • 3,900
  • 4
  • 28
  • 66