我最近在 Windows 7 上安装了最新版本的 UE 并创建了一个新的空 C++ 项目。创建项目后,它给我一个错误,说它无法编译。我在 VS 中打开项目来手动编译它,这是我得到的输出。
我上网查了一下,但没有得到答案。
编辑:我在编译非 UE 项目时使用这些标头没有任何问题。
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 ==========
真正让我困惑的是,它显然无法打开 new.h 和 windows.h,尽管当我检查它们的包含位置时,Visual Studio 打开文件没有问题。
创建虚幻引擎项目后,您可能会遇到如下错误:
- “致命错误 RC1015:无法打开包含文件‘windows.h’”
- “致命错误 C1083:无法打开包含文件:'新':没有这样的文件或目录”。
要修复它,请打开您的项目(不是 EU4 项目)属性/VC++ 目录。
如果您看到“包含目录”、“库目录”等空字段,请单击右侧的组合框并选择“从父级或项目默认值继承”。
然后再次编译项目。
图片如下:
默认项目模板
构建错误
选择从父级或项目默认值继承
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)