編譯lua源碼時,使用vs2012,遇到如下錯誤。
1>------ 已啟動生成: 項目: 20130925, 配置: Debug Win32 ------
1> stdafx.cpp
1>d:\code\20130925\20130925\stdafx.cpp(18): error 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> d:\vs2012\vc\include\stdio.h(218) : 參見“fopen”的聲明
1> 20130925.cpp
1> 正在生成代碼...
========== 生成: 成功 0 個,失敗 1 個,最新 0 個,跳過 0 個 ==========
解決方案,項目 ->屬性 -> c/c++ -> 預處理器 -> 點擊預處理器定義,編輯,加入_CRT_SECURE_NO_WARNINGS,即可。