fatal error RC1015: cannot open include file 'afxres.h'

I have just installed Visual C++ on my
computer.  I have tried to use the
application wizard to create an exe.
When I try to compile the project I keep getting this error.

Does anybody have any ideas??
Who is Participating?
nietodConnect With a Mentor Commented:
You're welcome.

>> How can I get you the points
I'll answer and then you can grade it.  The option would have been to just accept one of my comments as the answer.  (That option appears only when there is no answer pending, as there will be now that I have answered.)
just change file name as Afxres.h

it will work

suresh kumar
>> just change file name as Afxres.h
Huh?  what file name.

Afxres.h should be in the MFC\INCLUDE directory under your Vissual Studio directory.  first see if you can find this file.  You might want to use the "find files" option under the start button.

Once you have found the file, make sure that the directory that it is in is included in your VC's include file search path.  This appears at:

"Tools" menu
"Options" item
"Directories" tab
Show directories for "Include files"

Then make sure the path is listed in the list of paths.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

if there is no such a header file it will give error like

No such file or directory
It will also give you that error if the file exists and it can't find the file.  And that file had better exist.  It is one of the MFC files!  This is not a file that afpcos should write, it is one that is provided by VC for use with MFC.
afpcosAuthor Commented:

You had the right answer... How can I get you the points???

Thanks for your help!!
This error is a very common one, still now. I'm using VC.NET Beta 2 and the error appeared after some time of use every time I wanted to open any resource file.

I found another explanation of this bug:

When you have too many or too long include file paths in your settings this error accurs. If you delete some, the error won't accur any more.

I only wanted to comment on this, because this page is one of the first search results when searching for this bug, so others may find this solution quickly.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.