7

I'm new to VS2010 and tried to compile a project ever worked in VS2008. The error looks simple:

stdafx.h(43): fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory stdstring.h(619): fatal error C1083: Cannot open include file: 'TCHAR.H': No such file or directory threads.h(52): fatal error C1083: Cannot open include file: 'cassert': No such file or directory

I googled and this type of error happens often in VS2010 Express version, but I'm using VS2010 Professional Edition. And I've checked, all these missing files are at 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 thing is, other header files in stdafx.h is at the same directory as afxwin.h but didn't get complained.

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

Is there anything else that I forgot to check? Very much appreciated for the help.

4
  • Did you check that the files were added to your project?
    – Trisped
    Apr 20, 2012 at 21:41
  • It sounds to me like you had some paths setup in the old-style directory manager and they are not coming across to the new version and aren't included in the project directory settings. Check the two to see what's missing.
    – Robinson
    Apr 20, 2012 at 23:19
  • 2
    I manually added those directories of the header files to the "Additional Include Directories" under C/C++ => General as well and got a workaround. I think my VS installation may be screwed up somewhere at the beginning.
    – mile
    May 1, 2012 at 21:29
  • It sounds like the INCLUDE environment variable, and the corresponding settings in Visual C++, got messed up. Did the install directory get moved to a different drive/path?
    – Ben Voigt
    May 19, 2013 at 19:09

1 Answer 1

1

The properties explorer is where you want to look. Afxwin.h is in ..\atlmfc\include, tchar.h and cassert are in ..\include which you'd think would be a global-type property, but it turns out it's not so simple. This is the biggest problem I had with upgrading from 2008. This is no longer an application option, it's a user property.

Before you go about changing things, look the properties explorer and read the MSBuild documentation, because, while the new format is more powerful and flexible, but it doesn't upgrade from the old format gracefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.