調試程序時出現以下問題:d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\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]。
按照提示,作出以下修改:
及添加如下代碼 #define _AFXDLL
可是問題沒有解決,反而出現以下錯誤:
1>uafxcwd.lib(afxglobals.obj) : error LNK2001: 無法解析的外部符號 _IID_IWICImagingFactory
1>libcmtd.lib(wincrt0.obj) : error LNK2019: 無法解析的外部符號 _WinMain@16,該符號在函數 ___tmainCRTStartup 中被引用
1>C:\Users\zju\Documents\Visual Studio 2010\Projects\Test1\Debug\Test1.exe : fatal error LNK1120: 2 個無法解析的外部命令
在查閱相關資料后發現:靜態鏈接mfc庫的話,那么運行庫也得設置成靜態鏈接。 動態鏈接mfc庫,運行庫也得設置成動態鏈接。撤銷以前所做修改,做出如下修改: