Visual Studio 2010 C ++, Cannot open include file: 'afxwin.h', 'TCHAR.H' and 'cassert'

I am new to VS2010 and tried to compile a project ever working in VS2008. The error looks simple:

stdafx.h (43): fatal error C1083: cannot include include file: 'afxwin.h': no ​​such file or directory stdstring.h (619): fatal error C1083: unable to open include file: "TCHAR.H": no of such file or directory threads.h (52): fatal error C1083: cannot open include file: 'cassert': no ​​such file or directory

I am googled and this type of error often happens in VS2010 Express version, but I am using VS2010 Professional Edition. And I checked, all these missing files are in the right place. C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ VC \ atlmfc \ include and C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ VC \ include

The fact is that the other header files in stdafx.h are in the same directory as afxwin.h, but did not receive a complaint.

I also checked the VC ++ directories of the property manager, and the "Include Directories" includes "$ (VCInstallDir): $ (VCInstallDir) atlmfc \ include; $ (FrameworkSDKDir) \ include; $ (WindowsSdkDir) includes".

Is there anything else I forgot to check? Very grateful for the help.

+6
source share
1 answer

The property explorer is where you want to look. Afxwin.h is located in .. \ atlmfc \ include, tchar.h and cassert are in .. \ include, which you think will be a global type property, but it turns out that it is not so simple. This is the biggest problem I encountered when upgrading from 2008. This is no longer an application parameter, it is a user property.

Before starting the changes, review the properties explorer and read the MSBuild documentation, because while the new format is more powerful and flexible, it is not elegantly updated from the old format.

+1
source

Source: https://habr.com/ru/post/913754/


All Articles