Home > Fatal Error > Fatal Error C1189 #error File Must Be Compiled With _afxdll

Fatal Error C1189 #error File Must Be Compiled With _afxdll

Tuesday, August 04, 2009 12:43 PM Reply | Quote 0 Sign in to vote Ok, i've whittled it down to two headers that are causing me all this trouble. What exactly is the message? > > When you say that compiling your project as a shared MFC library > "automatically includes windows.h header", what do you mean exactly - does Based on your location, we recommend that you select: . But when you do this you must also use the DLL version of the CRT libraries (/MD compiler option). navigate here

Compiling... But this > > somehow > > automatically includes windows.h header and > > it is probably conflicts with windows.h which sits in static library xlw. > > Maybe I should Close × Select Your Country Choose your country to get translated content where available and see local events and offers. But there is a slight disconnect here. http://stackoverflow.com/questions/8747808/how-to-include-afxdll-compiler-option-while-compiling-in-visual-studio-8-and-u

Now the problem is I get the error message fatal error C1189: #error : file must be compiled with _AFXDLL when I include the header afxdll_.h. Saturday, August 01, 2009 5:12 PM Reply | Quote 1 Sign in to vote _AFXDLL tells the compiler to use the DLL version of the MFC libraries. How?

B] Where should I start looking for alternatives? Because of that, I am forced to compile my project as "Shared MFC library". Spring+SpringMVC+MyBatis详细整合过程 GIT科普系列3:底层存储机制I... 高并发重复请求的去重处理 findobj 点击按钮,正方形变红 关于我们| 免责声明| 广告服务| 联系我们 Copyright © 2011-2015 www.ithao123.cn IThao123.cn - IT行业第一站 All Rights Reserved 琼ICP备14001398号-3 Request unsuccessful. Apply Today MATLAB Academy New to MATLAB?

A virgin project is one created solely by the wizard (perhaps with a manual switch to static MFC linking, if you did not do it during project creation). Because of that, > > I am forced to compile my project as "Shared MFC library". Visual C++ MVP Saturday, August 01, 2009 3:52 PM Reply | Quote 0 Sign in to vote You need to get rid of the _AFXDLL definition. a fantastic read On Sun, Dec 21, 2008 at 3:25 PM, Eric Ehlers wrote: > Hi Boris, > > > What is happening is that I am linking my project with static xlw >

I'm using visual studio 2008 professional. How can I work around with this limitations? Ensure Use of MFC is set to "Use MFC in a Shared Library".This will ensure that all Visual Studio settings are configured for use of the MFC. 2 Comments Show all Do you have this _AFXDLL problem on a virgin static linked MFC application or not?

  • This project compiled with option: "Use Standard Windows Libraries".
  • Thanks all Wednesday, August 05, 2009 9:58 AM Reply | Quote Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.
  • Maybe I should compile xlw somehow different ...
  • In an effort to reduce contamination from my existing use of code I tried again from scratch.
  • Everything I've read so far suggests I shouldn't expect this.
  • Do you get the _AFXDLL problem in a virgin project of this type?
  • How to cope with too slow Wi-Fi at hotel? "Rollbacked" or "rolled back" the edit?
  • Related Content Join the 15-year community celebration.

asked 4 years ago viewed 1547 times active 3 years ago Related 6C++ Visual Studio Compilation error1Problem statically linking MFC libraries0How does one Create Managed C++ Static Library in Visual Studio check that Error executing cl.exe. Log In to answer or comment on this question. And you wrote down it as file name.But I doubt that to you it needs to be registered: most likely, it already is, since differently there would be no error:#if defined

Reload the page to see its updated state. check over here Please #define _AFXDLL or do not use /MD[d] ________________________________________________________________ If I will define #define _AFXDLL then Compiling... If I change configuration option for the project to "Use MFC in a Shared DLL" I am getting the following errors: Compiling... Now what could be wrong with my visual studio environment that causes this?

Is intelligence the "natural" product of evolution? I'm using plenty of other afx functions in my code already, so I don't understand why it's not working. A typical example of my codes dependency on _AFXDLL is the way it derives the command line string. his comment is here Can you generate the error by putting all the MFC/C/C++ #includes in stdafx.h?David Wilkinson | Visual C++ MVP Tuesday, August 04, 2009 3:24 PM Reply | Quote 0 Sign in to

Error using ==> mex at 208 Unable to complete successfully. July 31st, 2001, 03:04 PM Dooz Re: afxloadlibrary Are you including "afxdll_.h" in your project? I think if we included #define _AFXDLL in the source file it should prevent static linking.

I have written my program around the functionality of AfxInet.h and afxsock.h My program wont build statically linked whilst these two are on the scene.

I have made no code or property modifications. 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 _AFXDLL And where in it is possible to If it helps, the exact procedure i follow to create a virgin project is; Open visual studio "File">"New Project..." "Other Languages">"Visual C++">"MFC Application" [.NET Framework 2.0] *Assign a name and destination* Does anyone have a statically linked MFC test project that they can comile working that i can test here to rule out VS as the cause?

Mine is. Have you tried that?David Wilkinson | Visual C++ MVP Marked as answer by Admin0389 Wednesday, August 05, 2009 9:58 AM Tuesday, August 04, 2009 8:42 PM Reply | Quote All replies Books for chess traps Why is the spacesuit design so strange in Sunshine? http://indywebshop.com/fatal-error/fatal-error-c1189-define-afxdll.php Did you try what Hans suggested and put #undef _AFXDLL right before #include in your "stdafx.h"?David Wilkinson | Visual C++ MVP Tuesday, August 04, 2009 4:53 PM Reply | Quote

referenced in function "public: bool __thiscall xlw::XlfExcel::IsCalledByFuncWiz(void)const " ([email protected] @[email protected]@QBE_NXZ) ..\Debug\TestXLW.xll : fatal error LNK1120: 4 unresolved externals ________________________________________________________________ The reason I need to compile project with MFC because I need Sunday, August 02, 2009 12:35 PM Reply | Quote 0 Sign in to vote No repro, I didn't expect one.  View + (Other Windows) + Property Manager.  Open the Debug | As far as I can tell, afxver_.h is #included from "afx.h" which is is included from "afxwin.h". Screenshot 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

If you look at AfxInet.h and afxsock.h you not find any #define's of _AFXDLL.David Wilkinson | Visual C++ MVP Tuesday, August 04, 2009 1:46 PM Reply | Quote 0 Sign in A virgin project of this type gives the error; Error 1 fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds Excellent, i think we're on to something One last question, assuming I get static linking to work, with no reference to _AFXDLL, a command like... Please #define _AFXDLL or do not use /MD[d] ________________________________________________________________ If I will define #define _AFXDLL then Compiling...

Not the answer you're looking for? Tuesday, August 04, 2009 12:25 PM Reply | Quote Moderator 0 Sign in to vote Putting;   #undef _AFXDLL at the start and finish of every header (2 in project) yielded However, my C++ source file requires the usage of MFC in a shared DLL. I make use of the object CDynLinkLibrary defined in the #include .

Literally as soon as the wizard closes I build the project imediatly. xlwExample.cpp c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. This error is obviously before i even start coding or messing with settings etc.