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

后端 未结 3 1026
无人共我
无人共我 2021-02-20 02:16

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 f

相关标签:
3条回答
  • 2021-02-20 02:49

    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)"
    0 讨论(0)
  • 2021-02-20 02:58

    For what it's worth. I was getting similar errors after a fresh installation of VS2017. I installed the C++ features from the main installer and created a new project with MFC checked. I assumed "Microsoft Foundation Classes for C++" was installed by this point, but I kept getting these errors. Furthermore, after saving and closing the solution for the first time, VS wouldn't load the project if I opened the solution from the recently used list because dependencies were missing.

    What worked for me

    I opened the solution file directly using VS2017. Finally, VS informed me that "Microsoft Foundation Classes for C++" was not installed and gave me the option to install it. I had previously looked through the installer features and could not find this option.

    EDIT

    Per Vladimir's comment below...

    In 2017 Visual Studio Installer it ["Microsoft Foundation Classes for C++"] is under Modify / Individual Components / SDKs... / MFC and ATL support (x86 and x64)

    0 讨论(0)
  • 2021-02-20 03:14

    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.
    0 讨论(0)
提交回复
热议问题