C语言 Debian 上没有 stdint.h 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23973971/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
no stdint.h file on Debian
提问by ceremcem
I'm trying to use Chibios. The example code they provide seems to need stdint.h file. The Makefile gives the following error:
我正在尝试使用 Chibios。他们提供的示例代码似乎需要 stdint.h 文件。Makefile 给出以下错误:
/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.
我在网上找不到任何有用的东西。
采纳答案by ceremcem
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.
在 gcc-arm-embedded 团队(这里)的宝贵帮助下,我成功地编译了 Chibios 演示程序。我从他们的启动板站点下载了 gcc-arm-none-eabi-4_8-2014q1,它运行得很好。
回答by phord
#include_nextis used to let one file augment another one with the same name. In this case, it seems the "other one" is not available.
#include_next用于让一个文件扩充另一个具有相同名称的文件。在这种情况下,似乎“另一个”不可用。
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
我在尝试使用 Linux Mint 中的 gcc-arm 包 gcc-arm-none-eabi 编译我的代码时遇到了同样的错误。我通过安装 libnewlib-arm-none-eabi 解决了这个问题:sudo apt-get install libnewlib-arm-none-eabi
回答by gzerone
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.
嗯,我的回答不适合ARM,只是希望其他avr用户在遇到同样的问题时能得到帮助。
回答by Sauron
Probably you forgot to specify -ffreestandingoption of gcc.
可能你忘了指定-ffreestandinggcc 的选项。

