[{"data":1,"prerenderedAt":149},["ShallowReactive",2],{"page-Error-1":3,"page-count-Error":148},[4],{"id":5,"title":6,"body":7,"date":124,"description":13,"extension":125,"meta":126,"navigation":129,"path":141,"seo":142,"stem":143,"tags":144,"__hash__":147},"blogs\u002F_legacy\u002F2017\u002F2017-06-24-ue4-compile-errors-log.md","UE4错误笔记",{"type":8,"value":9,"toc":117},"minimark",[10,14,17,22,25,28,34,37,40,45,48,53,57,60,68,71,74,85,89,92,97,108,111],[11,12,13],"p",{},"记录了最近遇到的几个编译错误。",[11,15,16],{},"当前使用的UE4版本为4.15.3。",[18,19,21],"h2",{"id":20},"c4530","C4530",[11,23,24],{},"这个错误是尝试在UE4中使用Try\u002FExcept引起的。",[11,26,27],{},"报错如下：",[29,30,31],"blockquote",{},[11,32,33],{},"warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify \u002FEHsc",[11,35,36],{},"UE4默认的情况下不允许使用Exception。",[11,38,39],{},"AnswerHub有回答说要在build.cs中设置：",[29,41,42],{},[11,43,44],{},"UEBuildConfiguration.bForceEnableExceptions = true;",[11,46,47],{},"但是由于新版本的变更，这个属性变成只读了，现在需要这样设置：",[29,49,50],{},[11,51,52],{},"bEnableExceptions = true;",[18,54,56],{"id":55},"c2039","C2039",[11,58,59],{},"某种意义上的老朋友，报错如下：",[29,61,62,65],{},[11,63,64],{},"1>E:\\UEPro\\New_UI\\Plugins\\EasyLog\\Source\\EasyLog\\Private\\LogHolder.cpp(28): error C2039: “CreateDirectoryW”: 不是“IPlatformFile”的成员",[11,66,67],{},"1> f:\\epic\\ue_4.15\\engine\\source\\runtime\\core\\public\\GenericPlatform\u002FGenericPlatformFile.h(160): note: 参见“IPlatformFile”的声明",[11,69,70],{},"UE4中这种错误报进引擎内部的，一般都是因为定义冲突引起的，需要针对包含关系进行排查。",[11,72,73],{},"这种与Win Api相关的，通常是由于UE4中对Windows.h的兼容引起的。有时也会报出DWORD未定义这样的错误。可以尝试使用引擎提供的帮助包含：",[75,76,81],"pre",{"className":77,"code":79,"language":80},[78],"language-text","#include \"AllowWindowsPlatformTypes.h\"\n\n#include \"something_about_windows.h\"\n\n#include \"HideWindowsPlatformTypes.h\"\n","text",[82,83,79],"code",{"__ignoreMap":84},"",[18,86,88],{"id":87},"c4596","C4596",[11,90,91],{},"这个错误其实是VS2017的版本更新的新功能造成的，报错如下：",[29,93,94],{},[11,95,96],{},"error C4596: 'Blablabla': illegal qualified name in member declaration",[11,98,99,100,107],{},"详细的原因可以查看MSDN关于[",[101,102,106],"a",{"href":103,"rel":104},"https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fcpp\u002Fbuild\u002Freference\u002Fpermissive-standards-conformance",[105],"nofollow","permissive","]的文档，这个功能是为了让代码更加符合标准以提高代码的可移植性。",[11,109,110],{},"修正方式文档中已经有提供，通常都是类似这样的修改：",[75,112,115],{"className":113,"code":114,"language":80},[78],"template \u003Ctypename T_Ptr, typename Pred>\n\nclass RegistryWithPred : public AbstractRegistry\u003CT_Ptr, std::vector\u003CT_Ptr*>> {\n\npublic:\n- typedef typename RegistryWithPred\u003CT_Ptr, Pred>::iterator iterator;\n- typedef typename RegistryWithPred\u003CT_Ptr, Pred>::const_iterator const_iterator;\n+ typedef typename \u002F*RegistryWithPred\u003CT_Ptr, Pred>::*\u002Fiterator iterator;\n+ typedef typename \u002F*RegistryWithPred\u003CT_Ptr, Pred>::*\u002Fconst_iterator const_iterator;\n\nRegistryWithPred(void) {\n\n}\n",[82,116,114],{"__ignoreMap":84},{"title":84,"searchDepth":118,"depth":119,"links":120},2,3,[121,122,123],{"id":20,"depth":118,"text":21},{"id":55,"depth":118,"text":56},{"id":87,"depth":118,"text":88},"2017-06-24","md",{"layout":127,"status":128,"published":129,"author":130,"author_login":132,"author_email":133,"wordpress_id":134,"wordpress_url":135,"date_gmt":136,"excerpt":137},"post","publish",true,{"display_name":131,"login":132,"email":133,"url":84},"风铃","flinkor","flinkor@foxmail.com",1796,"\u002F\u002F?p=1796","2017-06-24 11:58:07 +0000",{"type":8,"value":138},[139],[11,140,13],{},"\u002F2017-06-24-ue4-compile-errors-log",{"title":6,"description":13},"_legacy\u002F2017\u002F2017-06-24-ue4-compile-errors-log",[145,146],"UE4","Error","N8GHUqThYgjHtwWVx0yo1qhwm9aqaEhhIWiClvRAHzo",1,1788763179922]