无法解析的外部符号_iob_func

问题描述:

在使用visual studio 2022 communicaty 中调用了graphics.h 库文件,结果编译时出现:

分析:

因VS不同版本之间对stdin,stdout,stder的定义不同,导致不同VS版本之间无法正确的调用函数。

解决办法:

增加转换函数

1 extern "C" FILE * __iob_func()
2 {
3     static FILE files[] = { *(stdin), *(stdout), *(stderr) };
4     return files;
5 }

参考资料:

https://blog.csdn.net/u010555230/article/details/77827767

posted @ 2022-01-27 20:24  吕辉  阅读(1068)  评论(0)    收藏  举报