c++ - Windows - VC++ - Can't "_ASSERTE" be used in static build -
i trying compile vc++ code in static mode(using /mt) in visual studio-2008. getting following error.
error please use /md switch _afxdll builds
i tried every options. errors due macro "_asserte". but, can't remove macros said super ordinate. awarded lots of thanks
there error telling real wrong program. while _asserte may proximate cause, there deeper underlying issue here need address.
your build scripts or source code #define-ing _afxdll, telling mfc plan use dll version of mfc. requires use dll version of crt well. /mt switch bringing in static version of crt.
my recommended solution use /md switch use crt dll mfc dll. don't explain why trying use /mt, doing right choice.
alternatively, if committed /mt route, should not define _afxdll.
finally, there small chance not intending use mfc @ all. in case, stop including mfc headers (afx*.h) , error go away.
martyn
Comments
Post a Comment