源码版添加varest插件的问题
本帖最后由 Covio 于 2017-3-7 16:30 编辑大家好,我用的是4.15的源码版,从商城里面下载了4.15对应的varest插件之后,放到引擎的插件目录里面,然后编译提示类似 “Expected VaRestJsonObject.h to be first header included”几个这种错误,提示让把头文件放到第一的位置,但是真的把头文件都放过去了,会报更多的错误出来,4.14里面我也用过这个插件,是没问题的,求帮助
找到问题了,是因为4.15添加了一个IWYU的规则,原文如下:
NEW: FASTER C++ COMPILE TIMESThe Unreal Engine 4 codebase now compiles up to 50% faster! Header files only include other headers they need, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h - we call this Include What You Use (IWYU).https://docs.unrealengine.com/latest/images/Support/Builds/ReleaseNotes/4_15/image_5.jpgThe conventions for the new model are as follows:
[*]Every header now includes everything it needs to compile - There is a CoreMinimal.h header that contains a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...), which is now included first by most headers.
[*]Every .cpp file includes its matching .h file first - This helps validate that each header is including everything it needs. UnrealBuildTool will check that source files adhere to this convention.
[*]No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more - You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
[*]No engine code explicitly includes a precompiled header any more - We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
Note: You can set ‘bEnforceIWYU = false’ from a *.build.cs file (or through the global BuildConfiguration.xml file) to disable warnings or errors about violations of these rules.
最好把compiler errors贴出来
4.15新的编译模型要求对header引用顺序有要求,比如刚才贴的错误信息是要说的#include "VaRestJsonObject.h”要求放在所有#include的第一个。这种情况需要改代码,而不是说让你要拷贝其他头文件。
4.15还有些接口变化,也会导致之前的代码编译错误,这个就要case by case的看了
coldfire913 发表于 2017-3-7 13:13
最好把compiler errors贴出来
4.15新的编译模型要求对header引用顺序有要求,比如刚才贴的错误信息是要说的 ...
非常感谢回复, 我更新了一下,加上了图片,我试了快三天了,也不知道该怎么解决,就是提示图片上这几个error,没有其它的比如变量未声明,函数未声明等等之类的错误提示出来,求指点一下 楼主解决问题后能把解决办法发出来,给后来人参考,真是善莫大焉 mknmknmk 发表于 2017-3-7 20:40
https://forums.unrealengine.com/showthread.php?137015-4-15-C-Transition-Guide
大神请问具体要怎么修改我也碰到这个问题了十万火急 求告知 大神请问具体要怎么修改我也碰到这个问题了十万火急 求告知
页:
[1]