0

I have a header file in a library which includes inttypes.h (required for using PRIu8, etc.). I am including the library header file into my own application file.

When I try to compile using arm-none-eabi-gcc in lpcxpresso(based on eclipse), I get the error

inttypes.h: No such file or directory

The build command is

arm-none-eabi-gcc -std=c99 -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_CMSIS=CMSISv1p30_LPC17xx -D__LPC17XX__ -D__REDLIB__ -I"some include" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/KISS_Server.d" -MT"src/KISS_Server.o" -MT"src/KISS_Server.d" -o "src/KISS_Server.o" "../src/KISS_Server.c"

Why am I getting this error?

I'm trying to compile for the LPC1769 which has a Cortex-M3 processor

4

1 回答 1

1

对于 arm-none-eabi,标头在独立环境(n1570、5.1.2.1)中是可选的。不知道您使用哪个主机,但在 Ubuntu 14.04 上,标头位于 gcc 的 /usr/lib/gcc/arm-none-eabi/4.8.2/include 中,并且仅包含少量标头。这是有道理的,因为没有标准库可以提供 printf & co。

但是,您也可以使用 newlib,它提供 stdlib 和 inttypes.h。另外,检查包含(和库)路径。

于 2015-05-26T23:18:11.890 回答