Fatal Error C1189 #error File Must Be Compiled With _afxdll
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to include _AFXDLL compiler option while compiling in visual studio 8 and “USING MFC as a Static Library” up vote 1 down vote favorite 1 I need to add translation for an old VS C++ application. This application and all the .lib files it implicitly links to are compiled by using MFC as Static Library. To translate the app into other languages I need to include resource dll's explicitly. I make use of the object CDynLinkLibrary defined in the #include
fatal error C1189: #error : file must be compiled with _AFXDLL 标签: error C2039fatal error C1189_AFXDLL 2013-07-17 16:57 1336人阅读 http://stackoverflow.com/questions/8747808/how-to-include-afxdll-compiler-option-while-compiling-in-visual-studio-8-and-u 评论(1) 收藏 举报 本文章已收录于: 分类: C/C++ 版权声明:本文为博主原创文章,未经博主允许不得转载。 1>D:\ProgramFiles(x86)\MicrosoftVisualStudio10.0\VC\atlmfc\include\afxdllx.h(55):errorC2039:“m_pClassInit”:不是“AFX_MODULE_STATE”的成员 1>D:\ProgramFiles(x86)\MicrosoftVisualStudio10.0\VC\atlmfc\include\afxstat_.h(210):参见“AFX_MODULE_STATE”的声明 1>D:\ProgramFiles(x86)\MicrosoftVisualStudio10.0\VC\atlmfc\include\afxdllx.h(56):errorC2039:“m_pFactoryInit”:不是“AFX_MODULE_STATE”的成员 1>D:\ProgramFiles(x86)\MicrosoftVisualStudio10.0\VC\atlmfc\include\afxstat_.h(210):参见“AFX_MODULE_STATE”的声明 1>D:\ProgramFiles(x86)\MicrosoftVisualStudio10.0\VC\atlmfc\include\afxdll_.h(21):fatalerrorC1189:#error:filemustbecompiledwith_AFXDLL 本人在windows系统的32bit—64bit移植,编译的时候碰到了上述问题一直找不到原因afxdllx.h是系统文件应该不会有问题才对呀,为什么会出现上面的问题呢? 其实最后一句话就是提醒就是你没有吧“_AFXDLL”加入到“预定义处理器”里。解决办法就不用多提了吧? 属性-》配置属性-》C/C++-》预处理器-》预处理器定义-》添加“_AFXDLL“。完事! http://blog.csdn.net/owangting/article/details/9357735 顶 0 踩 0 上一篇VS2010快捷键大全 下一篇LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用 /NODEFAULTLIB:library 我的同类文章 http://blog.csdn.net 参考知识库 更多资料请参考: 猜你在找 查看评论 * 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场 个人资料 Owangting 访问:5352次 积分:72 等级: 积分:72 排名:千里之外 原创:1篇 转载:6篇 译文:0篇 评论:1条 文章搜索 文章分类 转载(3) C/C++(1) 文章存档 2015年12月(1)2013年07月(3)2013年04月(3) 阅读排行 error C443
1 You must login or register to post a reply Topic RSS feed Posts [ http://www.progtown.com/topic1049521-md-switch-for-afxdll.html 4 ] 1 Topic by Earnest 2007-07-02 13:05:00 Earnest Member Offline Registered: 2013-05-19 Posts: 6,122 Topic: /MD switch for _AFXDLL _AFXDLL is a character of a https://sourceforge.net/p/xlw/mailman/message/21143956/ preprocessor, it registers in another way. And you wrote down it as file name.But I doubt that to you it needs to be registered: most likely, fatal error it already is, since differently there would be no error:#if defined (_AFXDLL)...And further it is necessary to install in adjustments of the project usage multitheread DLL: With ++\Code Generation\Runtime Library. In should be, accordingly, multithead debug. 2 Reply by Ivanalt 2007-07-03 05:40:00 Ivanalt Member Offline Registered: 2007-06-28 Posts: 23 Re: /MD switch for fatal error c1189 _AFXDLL And where in it is possible to install multithead debug???There only two windows - General and Addition DLL, but in them of anything similar it is not visible...Whether also it is necessary to erase in that case from adjustments in preprocessor AFXDLL??? 3 Reply by Ivanalt 2007-07-03 06:02:00 Ivanalt Member Offline Registered: 2007-06-28 Posts: 23 Re: /MD switch for _AFXDLL We put: a C/C ++-> code generation - use run-time library: Debug Multithreaded DLLOn an output it is received:Compiling resources... Compiling... Command line error D2016: '/ZI ' and '/O2 ' command-line options are incompatible Error executing cl.exe. Client_Side.exe - 1 error (s), 0 warning (s)We erase these options '/ZI ' and '/O2 ', we receive:Compiling resources... Compiling... StdAfx.cpp Compiling... Client_Side.cpp Client_SideDlg.cpp E:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxdll_. h (19): fatal error C1189: #error: file must be compiled with _AFXDLL Generating Code... Error executing cl.exe. Client_Side.exe - 1 error (s), 0 warning (s)WHERE:#ifndef _AFXDLL #error file m
instructions: Windows Mac Red Hat Linux Ubuntu Click URL instructions: Right-click on ad, choose "Copy Link", then paste here → (This may not be possible with some types of ads) More information about our ad policies X You seem to have CSS turned off. Please don't fill out this field. You seem to have CSS turned off. Please don't fill out this field. Briefly describe the problem (required): Upload screenshot of ad (required): Select a file, or drag & drop file here. ✔ ✘ Please provide the ad click URL, if possible: Home Browse XLW - A C++ wrapper for the Excel C API Mailing Lists XLW - A C++ wrapper for the Excel C API Brought to you by: adcockj, ericehlers, jlecomte, markjoshi, nando Summary Files Reviews Support Wiki Mailing Lists Tickets ▾ Bugs Support Requests Patches Feature Requests News Code xlw-announce xlw-cvs xlw-users Re: [Xlw-users] compiling static XLW library with MFC shared library project Re: [Xlw-users] compiling static XLW library with MFC shared library project From: Boris Skorodumov