Porting a class from MFC to a C++ Console Application . Building MFC application with /MD[d] (CRT dll version) requires
mfc, sockets, visual-c++, visual-studio-2010
Solution
In order to use any MFC stuff you need to link your program with MFC. the easiest way to do this is via the project properties. Open your project properties and go to "General". Select there "Use of MFC" either "use MFC in a static library" or "use MFC in a shared dll". Try to re-build your program. You may need to adjust some other options after that
Problem
I am trying to port a certain functionality from an MFC based application. Apparently I have no experience with MFC . The class of my interest inherits from CAsyncSocket. When looking that class up on MSDN , it states that the class is derived from `afxsock.h` . When I added that to my console application code I got the following error message which was ``` Error 1 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] d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h ``` Any suggestions on how I could resolve this issue ?