[UE4]v4.11.0release源码编译失败:error C2065: 'bAttributeLessDraw': undeclared identifi

 

UE4.11.0 release 源码编译时会报错:

 

F:\EpicGames\UnrealEngine-4.11.0-release\Engine\Source\Runtime\OpenGLDrv\Private\OpenGLCommands.cpp(2794): error C2065: 'bAttributeLessDraw': undeclared identifier

F:\EpicGames\UnrealEngine-4.11.0-release\Engine\Source\Runtime\OpenGLDrv\Private\OpenGLCommands.cpp(2800): fatal error C1020: unexpected #endif

 

解决办法:

注释掉报错的代码 OpenGLCommands.cpp(2794),出现这个问题应该是github上的ue4贡献开发者误提交导致的,以前拿源码编译没碰到这种问题

 

//  @Todo Workaround for radr://15076670 "Incorrect gl_VertexID in GLSL for glDrawElementsInstanced without vertex streams on Nvidia”
 #if PLATFORM_MAC
     if(bAttributeLessDraw)
     {
         glDisableVertexAttribArray(0);
         ContextState.VertexAttrs[0].bEnabled = false;
         ContextState.VertexStreams[0].VertexBuffer = nullptr;
     }
 #endif

 

如果是mac系统,则不能删除,否则会出现其他编译错误,在UE4论坛上看到的:

OpenGLCommands.cpp文件的编码格式修改为UTF8 BOM,默认是ANSI编码。

见:https://forums.unrealengine.com/showthread.php?106156-error-C2065-bAttributeLessDraw-undeclared-identifier-build-failed-with-4-11-0-release-source

 

2016-04-16更新:

在论坛上看到的,Epic的工程师说他们环境下没有这种问题,而提出这种问题的用户,操作系统的非unicode程序的编码格式都不是英语,所以,这也可能是git的问题。仅供参考。

 

2016-04-28更新:

感觉网友wdhwg001的回答:

第2793行末尾有一个”(中文右双引号),替换为英文双引号并保存即可。

 

猜你喜欢

转载自aigo.iteye.com/blog/2288279
今日推荐