Unreal Engine 4.10.1 can't compile Visual Studio 2015 project

我是研究僧i 提交于 2019-12-01 05:38:57

问题


I recently installed the most recent version of UE on my Windows 7 and made a new empty C++ project. After creating the project it gave me an error saying it failed to compile. I opened the project in VS to manually compile it and this is the output I got. I looked online but got no answers.

EDIT: I use these headers with no issues when compiling non-UE projects.

1>------ Build started: Project: RPG, Configuration: Development_Editor x64    ------
1>  Performing 7 actions (2 in parallel)
1>  [2/7] Resource PCLaunch.rc
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Launch\Resources\Windows\PCLaunch.rc(10): fatal error RC1015: cannot open include file 'windows.h'.
1>
1>  PCH.RPG.h.cpp
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(5): fatal error C1083: Cannot open include file: 'new': No such file or directory
1>  [3/7] Resource ModuleVersionResource.rc.inl
1>C:\Program Files\Epic Games\4.10\Engine\Source\Runtime\Core\Resources\Windows\ModuleVersionResource.rc.inl(3): fatal error RC1015: cannot open include file 'windows.h'.
1>
1>  -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Jack\Documents\Unreal Projects\RPG\Binaries\Win64\UE4Editor-RPG.dll
1>  Total build time: 3.64 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" RPGEditor Win64 Development "C:\Users\Jack\Documents\Unreal Projects\RPG\RPG.uproject" -rocket -waitmutex -2015" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The part that really confuses me is that it apparently can't open new.h and windows.h though Visual Studio has no problem opening the file when I check where they were included.


回答1:


After creating an Unreal Engine project you may face errors like:

  • "fatal error RC1015: cannot open include file 'windows.h' "
  • "fatal error C1083: Cannot open include file: 'new': No such file or directory".

To fix it open your project (not EU4 project) properties/VC++ Directories.

If you see empty fileds like "Include Directories", "Library Directories" then click on the combo box on the right side and choose "inherit from parent or project defaults". Then compile the project again.

Images below:

Default project template

Build errors

choose inherit from parent or project defaults



来源:https://stackoverflow.com/questions/34552036/unreal-engine-4-10-1-cant-compile-visual-studio-2015-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!