c:\documents and settings\develop\global\src\dwf\whiptk\embedded_font.h(282) : warning C4996: “strncpy”被声明为否决的
4>        c:\program files\microsoft visual studio 8\vc\include\string.h(156) : 参见“strncpy”的声明
4>        消息:“This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.”别人给的项目到我这里就不行了、  这个问题怎么解决

解决方案 »

  1.   

    VS 2005的吧。按照说明改用strncpy_s就可以了。
      

  2.   

    因为你的编译器版本比别人的高
    用deprecated声名的函数,编译的时候会输出包含某些编译信息的字符串。
    高版本编译器已经不使用这个选项了(我估计是因为unicode的原因),所以会有警告。
    把strncpy换成strncpy_s,或者使用_CRT_SECURE_NO_DEPRECATE选项,都可以解决
      

  3.   

    You should use strncpy_s. See "Security Enhancements in the CRT" on MSDN.
      

  4.   

    这个是vs2005 为了防止 数据溢出 给的警告  你使用  strmcpu_s就ok了
      

  5.   

    消息:“This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.” 用前查下MSDN就好了
      

  6.   

    把下面的代码加在strncpy语句前后就行了#pragma warning( disable : 4996 )
    strncpy(...)
    #pragma warning( default : 4996 )
      

  7.   

    "This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.” 
      

  8.   

    这个警告没有关系,可以不用管它。如果要解决这个问题,就不能使用strncpy函数,可以用strncpy_s代替。