Tuesday, November 18, 2008

error C2146: syntax error : missing ';' before identifier 'ContextRecord'

出現 error C2146: syntax error : missing ';' before identifier 'ContextRecord' 錯誤時,可能是 include 檔案的順序不對所致。改為這樣就對了。

#include stdio.h
#include windows.h
#include windef.h
#include winnt.h
#include basetsd.h

MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in libcmtd.lib(fclose.obj)

出現MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in libcmtd.lib(fclose.obj),可能是編譯的專案中有使用到一個 Lib,而兩個 Lib 編譯選項中Project->Setting->C/C++->Code Generation 中 Runtime Library 的設定不同。