如何修复 C 错误 'stderr undeclared'
问题:
你有类似这样的 C 代码
main.c
fprintf(stderr, "test");但当你尝试编译它时,你看到类似这样的错误消息
error_message.txt
/home/uli/myproject/main.c:9:25: error: ‘stderr’ undeclared (first use in this function)
fprintf(stderr, "test");解决方案
添加
stdio_include.c
#include <stdio.h>在错误发生的源文件顶部。包含 stdio.h 将包含 printf、fprintf、stdin、stdout 和 stderr 等符号。
Check out similar posts by category:
Allgemein
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow