虚幻引擎4.10.1无法编译使用Visual Studio 2015创建的项目。

3

我最近在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 ==========

我感到困惑的是,尽管在检查它们被包含在哪里时,Visual Studio没有问题打开new.h和windows.h文件,但它似乎无法打开它们。

可能是重复的问题:无法打开Windows.h - wimh
我在非UE项目中使用过该头文件,没有出现任何问题。 - Jack Fenech
1个回答

2
创建 Unreal Engine 项目后,您可能会遇到以下错误:
  • "fatal error RC1015: cannot open include file 'windows.h' "
  • "fatal error C1083: Cannot open include file: 'new': No such file or directory".
要修复它,请打开您的项目(不是 UE4 项目)属性/VC++ 目录。
如果您看到像“包含目录”、“库目录”这样的空字段,则单击右侧的组合框并选择“继承自父项或项目默认值”。然后重新编译项目。
下面是图片: 默认项目模板 构建错误 选择继承自父项或项目默认值 修复项目后

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接