记录一个Debug Assertion Failed

2020-10-22 19:02:16 浏览数 (1)

标准输出,错误输出,重定向到日志文件:

代码语言:javascript复制
logOutFp = freopen(logfile, "a", stdout);
logErrFp = freopen(logfile, "a", stderr);
    
    。。。
    
fclose(stdout);
fclose(stderr);

单独exe运行正常,,,

编译成dll后,被别的应用程序调用,报错,

Debug Assertion Failed! isatty.cpp Line: 17

Expression: (fh >=0 && ...

类似问题:

fclose causing Debug Assertion Failed crash. https://visual731.rssing.com/chan-13115559/all_p481.html

去掉fclose即可。

0 人点赞