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