I have a project in which I have to use a COM Module which uses MFC. I use CMake for making my project. Can anybody tell me what I have to include into my CMakeLists.txt so that I can use MFC in my project?
You need to add _AFXDLL
to the preprocessor definitions and set the CMake variable CMAKE_MFC_FLAG
to 1
for the static MFC library, or 2
for the shared one.
add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 1)
For further info run
cmake --help-variable CMAKE_MFC_FLAG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With