formate : #include "stdio.h" #include "stdlib.h" #include "m-6ren">
gpt4 book ai didi

file - 错误[P​​e020] : identifier "FILE" is undefined in IAR Workbench

转载 作者:行者123 更新时间:2023-12-02 10:42:34 25 4
gpt4 key购买 nike

// Preprocessor directive mention in <> formate :
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include "string.h"
#include "limits.h"
#include "stddef.h"
#include "stdint.h"
...
int main()
{
FILE *fin, *fout; //Error[Pe020]: identifier "FILE" is undefined
...
...
...
fprintf(stderr, "%s\n", opus_get_version_string());
//Error[Pe020]: identifier "stderr" is undefined

}

根据上面的代码,我得到了两个错误:

1) “错误[Pe020]:标识符“FILE”未定义”

当我找到 stdlib.h 时,就没有任何类型的“FILE”指令定义或 typedef。
所以,请告诉我 stdlib.h 或 stdio.h 中需要哪些更改

2) 错误[P​​e020]:标识符“stderr”未定义

那么,stderr 在哪个头文件中定义?

请告诉我如何解决上述错误?

提前致谢。

最佳答案

一、FILEstdio.h不在 stdlib.h .二、默认库不包含FILE支持,因为此功能占用大量空间并且在嵌入式系统中很少需要。使用 FILE您必须在配置对话框中切换到完整的库(如果您使用 IDE)或使用命令行开关 --dlib full (如果您从命令行使用编译器)。

请注意,完整库比普通库大得多,因此如果仅使用 FILE是将诊断消息打印到 stderr我建议您使用其他方式来呈现消息。

关于file - 错误[P​​e020] : identifier "FILE" is undefined in IAR Workbench,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49643186/

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