Discussion:
Compiler: fatal error RC1015: cannot open include file 'afxres.h'.
(too old to reply)
Jarred Ward
2003-06-30 07:20:42 UTC
Permalink
VS.NET 2003:

Afxres.h exists and I can edit the .rc just fine, but it
will not compile and returns the above error.

Supposedly the 512-byte error was fixed in VS.NET 2003,
so what is going on here?
Jacob Yang [MSFT]
2003-07-01 08:33:13 UTC
Permalink
Hi Jarred,

As I understand, you encouned the following error in VS.NET 2003:

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

I am researching this issue now and will contact you as soon as possible.

Best regards,

Jacob Yang [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Jarred Ward
2003-07-07 01:42:40 UTC
Permalink
Yes, I was referring to that KB as a possible solution for the problem. The
KB also states this was fixed in VS.NET 2003, which I am using. So this
leads me to the source of my problem.

As far as reproducing the error, I cannot tell you how to break VS.NET 2003
like I did, but this is how I can reproduce it on my machine:

Create a MFC Application project w/ default settings
Build the solution and it'll return:
- fatal error RC1015: cannot open include file 'afxres.h' - whatever.rc

Everything but the resource compiler can see 'afxres.h'.
Jacob Yang [MSFT]
2003-07-10 04:55:24 UTC
Permalink
Hi Jarred,

I cannot reproduce the problem on my side.

Please check the Include Path on your side. If it is not too long, there
must be some problem on your VS.NET 2003. Please try a repaire of VS.NET
2003.

If the Include Path is very long, please remove some of the Include paths:

1. On the Tools menu, click Options.
2. In the left pane of the Options dialog box, click the Projects folder,
and then click VC++ Directories.
3. In the Show directories for list, click Include files.
4. In the lower window, delete some of the paths, and then click OK.

Best regards,

Jacob Yang [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Jarred Ward
2003-07-10 08:53:35 UTC
Permalink
I ran a repair and that did not work.

My Include files directory has the defaults:

- $(VCInstallDir)include
- $(VCInstallDir)atlmfc\include
- $(VCInstallDir)PlatformSDK\include\prerelease
- $(VCInstallDir)PlatformSDK\include
- $(FrameworkSDKDir)include

Any more suggestions short of uninstall/reinstall?
Jacob Yang [MSFT]
2003-07-13 08:26:21 UTC
Permalink
Hi Jarred,

The "Include files directory path" is OK on your machine. So what you
encounered is not the same problem as the the problem of 326987 - FIX:
RC1015 Error When Using Resource View If the Include Path is Too Long. The
problem of 326987 is caused by an excessively long Include files directory
path (over 512 bytes).

More time is needed for this issue. Thank you for your understanding.

Best regards,

Jacob Yang [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Scott Jones
2003-08-20 23:19:11 UTC
Permalink
I had this problem too, and found that the advice offered in the KB 326987
article did not help at all. After some trial and error, I finally found
the culprit. It is indeed an include path length limitation, but it is not
just Tools.Options.Projects.VC++Directories. If your project's
C/C++.General.Additional Include Directories entry is too long, that will
also cause the RC1015 ... afxres.h error. The workaround I found was to
copy all the /I compile options generated by the C/C++.General.Additional
Include Directories entry and move them into the C/C++.Command
Line.Additional Options entry. This will allow the project to compile
normally without breaking the resource editor.

Good luck!
Jacob Yang [MSFT]
2003-08-21 05:57:18 UTC
Permalink
Hi Scott,

Thank you very much for sharing your resolution. It will be helpful to
everybody here.

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! šC www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Continue reading on narkive:
Search results for 'Compiler: fatal error RC1015: cannot open include file 'afxres.h'.' (Questions and Answers)
3
replies
My comp freezes so I have to exit out and it says program not responding or it says Java(TM) Fatal error?
started 2006-10-28 12:51:06 UTC
software
Loading...