Cannot open source file "afxwin.h" / "afxext.h" / "afxdisp.h" / "afxdtctl.h" / "afxcmn.h" /afxdisp.h etc.

I am trying to run the previous written MFC C ++ code on my 2015 MFC visual studio with the multithreading library installed in MATL.

However, I still have 12 errors regarding the missing function:

IntelliSense: cannot open source file "afxwin.h" C1083 Cannot open include file: 'afxwin.h': No such file or directory cannot open source file "afxext.h"/"afxdisp.h"/"afxdtctl.h"/"afxcmn.h"/afxdisp.h etc....

Where can I get these files?

Again, my setup is:

VIsual studio 2015 ultimate MFC Installed Multibyte MFC library Windows 8 - 64-bit machine

Thanks!

+7
c ++ visual-c ++ visual-studio-2015 mfc
source share
2 answers

I just fixed a similar problem. Here you can solve this problem.

  • Go to control panel
  • Go to uninstall / change the program.
  • Scroll down until you see the installation of your visual studio.
  • Click change
  • As soon as the window appears, click "Edit"
  • In programming languages โ€‹โ€‹-> Visual C ++ Make sure that "Microsoft Foundation Classes for C ++" is checked. If it does not select it and click "Update."
+9
source share

What is it worth? I got similar errors after a new installation of VS2017. I installed C ++ functions from the main installer and created a new project with MFC validation. I assumed that โ€œMicrosoft Foundation Classes for C ++โ€ was installed by now, but I kept getting these errors. In addition, after saving and closing the solution for the first time, VS will not load the project if I opened the solution from a recently used list because there were no dependencies.

What worked for me

I opened the solution file directly with VS2017. Finally, VS informed me that โ€œMicrosoft Foundation Classes for C ++โ€ was not installed and gave me the opportunity to install it. Previously, I looked through the installation functions and could not find this option.

0
source share

All Articles