visual-c++ - 错误 C4996 : 'strerror' : This function or variable may be unsafe

标签 visual-c++ itk

我正在使用 Visual Studio 2013 和 ITK 4.3 进行图像分割,但出现错误:

\itk4.3.1-64bit\debug\include\itk-4.3\gdcmVR.h(168): error C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

如何克服这个错误?

最佳答案

通常您可以执行以下操作,但如果您使用的是 cmake,那么您可能希望将此选项添加为 cmake 中的附加编译器标志。

右键单击项目,然后导航到

  • 配置属性
  • C/C++
  • 命令行

在下方的 Additional Options 部分中,您可以添加: -D_SCL_SECURE_NO_WARNINGS

example

附加信息 here .

关于visual-c++ - 错误 C4996 : 'strerror' : This function or variable may be unsafe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37166781/

相关文章:

c++ - 在不同 DLL 之间传递的标准对象

visual-c++ - Open CV中的代码运行时间?

c++ - 当我只知道图像的物理边界时,如何填充图像?

installation - 安装 ITK 的困难

c++ - c++中存储的非标准函数的声明在哪里?

c++ - 在 midl 生成的头文件中定义一个结构

c++ - 如何将 std::string 传递给需要 char* 的函数?

c++ - crt1.o : In function `_start' : (.text+0x20): undefined reference to `main'

c++ - vtkResliceImageViewer 显示不正确(太暗)的 dicom 图像

c++ - 从 .dcm 文件生成和读取 .vtk 文件,以及修改模型