- фатальная ошибка RC1015
- Решение
- Fatal error rc1015 cannot open include file windows h
- Answered by:
- Question
- Answers
- All replies
- Fatal error rc1015 cannot open include file windows h
- Answered by:
- Question
- Answers
- All replies
- Cannot open include file ‘afxres.h’ in VC2010 Express
- 8 Answers 8
- Cannot open Windows.h in Microsoft Visual Studio
- 7 Answers 7
фатальная ошибка RC1015
Я действительно новичок в программировании для C++ и мне дали задание поднять, если предыдущий сотрудник прекратил программировать на устройстве Windows Mobile. Эмулятор работал на прошлой неделе, и теперь, когда я загружаю программу, я получаю:
Неустранимая ошибка RC1015: не удается открыть файл включения «xxxx.h»
Я перепробовал почти все, что видел в интернете, без единого везения. Я думаю, что одно из моих включенных утверждений отсутствует, но каждый раз, когда я добавляю одно из них, что-то срабатывает, что-то еще ломается. Пожалуйста, любая помощь будет принята с благодарностью.
Вот что .rc Файл говорит:
Проблема с #include «ConnectLoginDlgsRes.h» линия. Заголовочный файл находится в общей папке, которая, если она добавлена, ломается где-то еще.
Есть идеи? Как я сказал, кто-то еще начал это, и я понял это.
Решение
Поскольку вы программируете для Windows Mobile, мы можем предположить, что вы используете VS2005 или VS2008. Вам просто нужно установить путь поиска для компилятора ресурсов.
Найдите отсутствующий файл «ConnectLoginDlgsRes.h» и добавьте путь в диалоговом окне свойств проекта. Путь должен быть добавлен в Configuration Properties -> Resources -> General , Используйте «Дополнительный стандартный путь включения».
Редактировать:
Поскольку ваш предыдущий сотрудник мог дать вам рабочий проект, вам также следует проверить среду сборки. Вероятно, вам нужно выполнить некоторые сценарии, прежде чем вы действительно сможете построить проект VS.
Fatal error rc1015 cannot open include file windows h
Answered by:
Question
I’ve read several forum posts that are similar to this question, without help. I’m using VC++ Express
My winres.h is located in:
C:\Program Files\Microsoft Platform SDK\include\mfc
I tried adding the above to my dependencies and also tried this:
C:\Program Files\Microsoft Platform SDK\include\mfc\winres.h
I have tried adding these Lines to
I tried different combinations of the above, just one or all etc. I even copied winres.h to my solution and put it directly in my include folder. It still can’t open the darn file.
Any idea why, it can’t open this file?
Second but related question:
I also tried looking at my project’s .rc file in resource view. It says:
resource editing is not supported in VC++ Express SKU
Is this going to be a problem when trying to create apps with resources?
Thanks for your help
Answers
NOTE: I very much appreciate your help SvenC
I found the solution on another forum; I want to share the solution here so that others with the same problem might benefit.
Problem: We want the compiler to find and open winres.h, located in
C:\Program Files\Microsoft Platform SDK\include\mfc
The proper place to add this directory:
Tools->Options->VC++ Directories->Include Files
All replies
VC++ Express has no ATL and MFC support. So it might be the problem.
The above project settings in C/C++ — General are correct. It should work. When including with path did you remember to double each \ character as it otherwise starts escape sequences. Could you show that include line?
Sure thanks for you help, The include is:
C:\Program Files\Microsoft Platform SDK\include\mfc
C:\Program Files\Microsoft Platform SDK\include\mfc\winres.h
I also tried — after reading your response
C:\\Program Files\\Microsoft Platform SDK\\include\\mfc
So you have this line:
#include «C:\\Program Files\\Microsoft Platform SDK\\include\\mfc\\winres.h»
and it still says it cannot include that file? Is the error really from that location or from another file which does just #include «winres.h»?
You can also add global include directories to the VC options: Tools->Options->Projects and solutions : VC++ directories. Try that and do use single \ here or even better browse the directories you want to add.
If that doesn’t work it seems to be an extra limitation of VC++ express — would not have expected that.
NOTE: I very much appreciate your help SvenC
I found the solution on another forum; I want to share the solution here so that others with the same problem might benefit.
Problem: We want the compiler to find and open winres.h, located in
C:\Program Files\Microsoft Platform SDK\include\mfc
The proper place to add this directory:
Tools->Options->VC++ Directories->Include Files
Fatal error rc1015 cannot open include file windows h
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Last night, while trying to get VS 2015 to use the Windows 10 SDK, I managed to mess up the IDE to the point where a fresh install sounded like a good idea.
I went to MS’s VS Community site for the latest download. 2017 is now the default offered version, so I downloaded and installed it.
The compilation failed. The only error found is in the .RC file:
Nothing was found when I searched for the header file on the C: drive.
Commenting out the include caused other errors.
Answers
thanks for posting here.
>> VS 2017 .RC file — Error RC1015 cannot open include file ‘afxres.h’
For this case, I suggest you check if you have installed vc++ feature especially the MFC support with vs2017.
If not, please modify your vs2017 and add these features.
Hope this could be help of you.
Best Regards,
Sera Yu
MSDN Community Support
Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
All replies
thanks for posting here.
>> VS 2017 .RC file — Error RC1015 cannot open include file ‘afxres.h’
For this case, I suggest you check if you have installed vc++ feature especially the MFC support with vs2017.
If not, please modify your vs2017 and add these features.
Hope this could be help of you.
Best Regards,
Sera Yu
MSDN Community Support
Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
I couldn’t find a description of what components I’d installed so I did a re-install of VS2017.
The default install didn’t have the «MFC and ATL support (x86 and x64)» item selected by default. I selected that item, along with a bunch of other things.
Is there a quick method to change the SDK version for every project in a «Solution»?
It was tedious going through the properties for 34 projects.
After setting each project’s SDK, the build was successful.
I appreciate your assistance.
If you want to update the same project settings over multiple projects, you can hold down control and left click on each project that you want to change the settings on. If you then go into the project properties, then the common properties between those projects will be editable and any changes will apply to all projects that you had selected.
This may perform terribly though, so be warned.
This is a signature Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
Cannot open include file ‘afxres.h’ in VC2010 Express
I’m trying to compile an old project using VS express 2010 but I get this error:
fatal error RC1015: cannot open include file ‘afxres.h’. from this code
I have installed Windows SDK already, but without any success.
8 Answers 8
This header is a part of the MFC Library. VS Express edition doesn’t contain MFC. If your project doesn’t use MFC you can safely replace afxres.h with windows.h in your terrain2.rc .
Had the same problem . Fixed it by installing Microsoft Foundation Classes for C++.
- Start
- Change or remove program (type)
- Microsoft Visual Studio
- Modify
- Select ‘Microsoft Foundation Classes for C++’
- Update
Even I too faced similar issue,
fatal error RC1015: cannot open include file ‘afxres.h’. from this code
Replacing afxres.h with Winresrc.h and declaring IDC_STATIC as -1 worked for me. (Using visual studio Premium 2012)
Alternatively you can create your own afxres.h:
You can also try replace afxres.h with WinResrc.h
managed to fix this by copying the below folder from another Visual Studio setup (non-express)
from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc
to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc
a similar issue is for Visual studio 2015 RC. Sometimes it loses the ability to open RC: you double click but editor do not one menus and dialogs.
Right click on the file *.rc, it will open:
Cannot open Windows.h in Microsoft Visual Studio
First of all: I’m using Microsoft Visual Studio 2012
I am a C#/Java developer and I am now trying to program for the kinect using Microsoft SDK and C++. So I started of with the Color Basics example, and I can not get it to compile. At first, none of the classes were able to find Windows.h. So I installed (Or re-installed, I’m not sure) the Windows SDK, and added the include dir of the SDK to the include «path» of the project. Then all the problems were gone, except for one:
And thats the error. No reasons why, the system can find it because it is used in multiple other files, only this file is not able to work with it. As a reference, the entire file that is bugging (ColorBasics.rc):
7 Answers 7
If you already haven’t done it, try adding «SDK Path\Include» to:
And add «SDK Path\Lib» to:
Also, try to change «Windows.h» to
If won’t help, check the physical existence of the file, it should be in «\VC\PlatformSDK\Include» folder in your Visual Studio install directory.
Start Visual Studio. Go to Tools->Options and expand Projects and solutions. Select VC++ Directories from the tree and choose Include Files from the combo on the right.
If this is missing, you found a problem. If not, search for a file. It should be located in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
if VS was installed in the default directory.
If you are targeting Windows XP ( v140_xp ), try installing Windows XP Support for C++.
Starting with Visual Studio 2012, the default toolset (v110) dropped support for Windows XP. As a result, a Windows.h error can occur if your project is targeting Windows XP with the default C++ packages.
Check which Windows SDK version is specified in your project’s Platform Toolset. ( Project → Properties → Configuration Properties → General ). If your Toolset ends in _xp , you’ll need to install XP support.
Open the Visual Studio Installer and click Modify for your version of Visual Studio. Open the Individual Components tab and scroll down to Compilers, build tools, and runtimes. Near the bottom, check Windows XP support for C++ and click Modify to begin installing.