Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I try to ran a previous written MFC c++ code on my visual studio 2015 MFC with multitype MFC library installed.

However, I still have 12 errors here regarding 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 head files?

Again, my set up is:

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

Thanks!

like image 654
Curly Avatar asked Apr 27 '15 14:04

Curly


2 Answers

I just fixed a similar problem. Here's how you can resolve this.

  1. Go to your control panel
  2. Navigate to uninstall/change a program.
  3. Scroll down until you see your visual studio installation
  4. Click change
  5. Once the window pops up, click "Modify"
  6. Under Programming Languages -> Visual C++ Make sure "Microsoft Foundation Classes for C++" is checked. If it isn't select it and click update.
like image 127
tf245yay Avatar answered Sep 22 '22 19:09

tf245yay


For VS2019 the above solutions didn't worked for me. I had to go to "Installer -> Individual Components -> " and install the following to solve the issue:

  • "MSVC v141 – VS 2017 C++ x64/x86 build tools (v14.16)"
  • "C++ MFC for v141 build tools (x86 & x64)"
  • "C++ ATL for v141 build tools (x86 & x64)"
like image 41
igoyetche Avatar answered Sep 20 '22 19:09

igoyetche