gpt4 book ai didi

c - PIC Micro 无法找到 'inttypes.h'

转载 作者:行者123 更新时间:2023-11-30 17:40:19 27 4
gpt4 key购买 nike

我有一个 C 语言代码,我将在 PIC 微 Controller 上运行。我正在使用 Mplab IDE 8.92 和 Mplab C18 3.46。我以前从未使用过微 Controller 这样做过。
在我使用 Mingw 编译此代码之前。但是现在我使用 Mplab 时出现错误:
无法找到“inttypes.h”
我该如何解决这个问题和同样的问题?

编辑---------我的微 Controller 是 PIC18f2550。我使用了 mplab c18 和 mplab xc8,两者都出错。然后为了测试,我使用了 mplab xc32 和微 piC32...!编译没有任何问题。
我可以使用 xc8 的 x32 头文件吗?

最佳答案

inttypes.h是一个C99文件,MPLAB C18仅支持C89。

How do I solve this problem and same problems?

inttypes.h 定义了一些宏并包含 stdint.h C99 header 。尝试删除源文件中 inttypes.h 的包含行,并声明自己缺少的类型(例如 typedef unsigned char uint8_t; 等)。

关于c - PIC Micro 无法找到 'inttypes.h',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21563155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com