error called MFC shared dll version

Asha Diggi 96 Reputation points
2021-04-15T10:46:13.903+00:00

Hi all,

I am trying to run my MFC application in eclipse IDE,

I installed Eclipse IDE then istalled Eclipse CDT plugin,

then installed visual C/C++ toolchain in Eclipse IDE,

I am able to see the toolchain while clicking project->properties->C/C++ build ->tool chain editor->current tool chain->Microsoft Visual C++.

Now I am trying to build my MFC application in Eclipse IDE using visual studio tool chain,

but getting the following error:

"C:\Program Files\MicrosoftVisualStudio\VC\Tools\MSVC\14.21.27702\atlmfc\include\afx.h(24): 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]"

I am creating project using below steps:

Eclipse IDE

File->New->C++ Project->Project name->"name of the project"

Project Type->Empty project

Toolchain-> Microsoft Visual C++

Finish.

After this adding the source file right clicking on project->New->File.

getting error "fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory"

to solve this issue include the afxwin.h file, clicking on project properties->C/C++ build->Environment->INCLUDE ="path to that file".

I am able to solve the above error but after this getting a error

"C:\Program Files\MicrosoftVisualStudio\VC\Tools\MSVC\14.21.27702\atlmfc\include\afx.h(24): 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]"

I tried selecting Multi-threaded DLL debug option.

Project properties->settings->Tool setting->C++ compiler->code generation->Run time library->selecting "Multi-threaded DLL debug /MDb"

but then also I am not able to run the project successfully getting same error,

Can anyone help to solve these issue...

Regards,
Asha.

Developer technologies C++
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.