Solution: MFC and fatal error C1189

今天用Visual Studio 2005開一個空白專案,撰寫一個MFC的程式,遭遇了fatal error C1189
錯誤訊息前略...
include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]

解決方式
調整專案的屬性,將MFC的DLL設定到位

1. 對著專案按右鍵→「屬性」

2. 「組態屬性」.「一般」.「MFC的使用」選擇「使用MFC的共用DLL」或是靜態MFC函式庫

留言