简体   繁体   English

虚幻引擎4.10.1无法编译Visual Studio 2015项目

[英]Unreal Engine 4.10.1 can't compile Visual Studio 2015 project

I recently installed the most recent version of UE on my Windows 7 and made a new empty C++ project. 我最近在Windows 7上安装了最新版本的UE,并创建了一个新的空C ++项目。 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. 我在VS中打开项目手动编译它,这是我得到的输出。 I looked online but got no answers. 我在网上看了但没有得到答案。

EDIT: I use these headers with no issues when compiling non-UE projects. 编辑:我在编译非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 ==========

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. 真正让我困惑的部分是它显然无法打开new.h和windows.h虽然Visual Studio在检查文件的位置时打开文件没有问题。

After creating an Unreal Engine project you may face errors like: 创建虚幻引擎项目后,您可能会遇到以下错误:

  • "fatal error RC1015: cannot open include file 'windows.h' " “致命错误RC1015:无法打开包含文件'windows.h'”
  • "fatal error C1083: Cannot open include file: 'new': No such file or directory". “致命错误C1083:无法打开包含文件:'new':没有这样的文件或目录”。

To fix it open your project (not EU4 project) properties/VC++ Directories. 要修复它,请打开您的项目(而不是EU4项目)属性/ VC ++目录。

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". 如果您看到“Include Directories”,“Library Directories”等空文件,请单击右侧的组合框,然后选择“从父​​项目或项目默认值继承”。 Then compile the project again. 然后再次编译项目。

Images below: 下图:

Default project template 默认项目模板

Build errors 构建错误

choose inherit from parent or project defaults 从父项目或项目默认值中选择继承

项目修复后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM