当我在 Visual Studio 2012(我使用的是 C++)中使用以下代码时出现上述错误:
#include <tesseract\baseapi.h>
任何人都可以阐明可能出了什么问题吗?
最佳答案
默认情况下不推荐使用非安全 CRT 函数。您可以通过定义宏 _CRT_SECURE_NO_WARNINGS
重新启用它们。尝试-
#define _CRT_SECURE_NO_WARNINGS
#include <tesseract\baseapi.h>
或者将宏添加到项目属性列表中。阅读文章 Eliminating Deprecation Warnings在 MSDN。
来自文章-
There are several ways to eliminate deprecation warnings for the older, less secure functions. The simplest is simply to define _CRT_SECURE_NO_WARNINGS or use the warning pragma. Either will disable deprecation warnings, but of course the security issues that caused the warnings still exist. It is far better to leave deprecation warnings enabled and take advantage of the new CRT security features.
关于c++ - Tesseract baseapi 错误 : 'strncpy' :this function or variable may be unsafe. 考虑改用 strncpy_s,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22423925/