PHP擴展開發(6) - VS2012下strncasecmp和fopen函數warning

1. fopen
 

warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdio.h(211) : see declaration of 'fopen'ide

 
解決方法:
 
加宏      _CRT_SECURE_NO_WARNINGS
 
右鍵項目 -> 屬性 -> 預處理(Preprocessor) -> 預處理定義(Preprocessor Definitions) -> 把宏加進去
 
 
 
2. strncasecmp、strnicmp
 
 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strnicmp. See online help for details.
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string.h(255) : see declaration of 'strnicmp'
 
解決方法:
 
加宏
_CRT_SECURE_NO_DEPRECATE=1
_CRT_NONSTDC_NO_DEPRECATE=1
 
右鍵項目 -> 屬性 -> 預處理(Preprocessor) -> 預處理定義(Preprocessor Definitions) -> 把宏加進去 
相關文章
相關標籤/搜索