1
votes

I'm not a C++ developer so be gentle with me.

I am working on a legacy c++ solution and I have added a new managed project. All other projects are unmanaged. The new project is configured as Use of MFC : 'Use MFC in a shared dll'.

I have also made some changes to one of the existing projects to call my new code. This is configured as 'Use standard Windows Libraries'.

My problem is that when I try and build the existing project with my changes I get the following error:

Error 1 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]

Why does the compiler think this is an MFC project when it is configured as 'Use standard Windows Libraries'?

1
in the project's settings, what is the compiler command line?onof
Why does your managed project (I assume you mean C++/CLI) make use of MFC at all?Cody Gray
Cody: It probably doesn't have to. But why is this affecting the compilation of the unmanaged project?HammerIp
I'm not necessarily arguing that it is. I just noticed that and stopped reading there. Are the two projects part of a single solution that you're compiling together?Cody Gray

1 Answers

0
votes

I am looking at MSDN definition of the error (C1189: http://msdn.microsoft.com/en-us/library/y0tzt8e0%28v=vs.80%29.aspx) and it seems to be definition issues. Now, the description from your compiler is ambiguous but if you fix the '#define' problems the compiler can point more accurately to other problems.

Hope it helps, Sun