当前位置:   article > 正文

UE4 报错 missing type specifier - int assumed

UE4 报错 missing type specifier - int assumed

没有提示的错误,但是编译时就出现:missing type specifier - int assumed

我出现的原因是在使用MergeActor时,

#include "Editor/MergeActors/Public/IMergeActorsModule.h"

当在其他文档引用时,build的时候,就提示 MergeActorsModule.h文件中很多错误,就包括missing type specifier - int assumed。

解决办法:

MergeActors是一个单独的Module,在其他Module中使用时,添加头文件后,要在Build.cs文件中添加相应Module,才会正常,如我在ContentBrowser.Build.cs中添加,如下:

  1. // Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
  2. using UnrealBuildTool;
  3. public class ContentBrowser : ModuleRules
  4. {
  5. public ContentBrowser(ReadOnlyTargetRules Target) : base(Target)
  6. {
  7. PrivateIncludePathModuleNames.AddRange(
  8. new string[] {
  9. "AssetRegistry",
  10. "AssetTools",
  11. "CollectionManager",
  12. "EditorWidgets",
  13. "GameProjectGeneration",
  14. "MainFrame",
  15. "PackagesDialog",
  16. "SourceControl",
  17. "SourceControlWindows",
  18. "MergeActors"
  19. }
  20. );
  21. PrivateDependencyModuleNames.AddRange(
  22. new string[] {
  23. "AppFramework",
  24. "Core",
  25. "CoreUObject",
  26. "ApplicationCore",
  27. "InputCore",
  28. "Engine",
  29. "Slate",
  30. "SlateCore",
  31. "EditorStyle",
  32. "SourceControl",
  33. "SourceControlWindows",
  34. "WorkspaceMenuStructure",
  35. "UnrealEd",
  36. "EditorWidgets",
  37. "Projects",
  38. "AddContentDialog",
  39. "DesktopPlatform",
  40. "XmlParser",
  41. }
  42. );
  43. DynamicallyLoadedModuleNames.AddRange(
  44. new string[] {
  45. "PropertyEditor",
  46. "PackagesDialog",
  47. "AssetRegistry",
  48. "AssetTools",
  49. "CollectionManager",
  50. "GameProjectGeneration",
  51. "MainFrame",
  52. "MergeActors"
  53. }
  54. );
  55. PublicIncludePathModuleNames.AddRange(
  56. new string[] {
  57. "IntroTutorials"
  58. }
  59. );
  60. }
  61. }

之后就正常了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/108570
推荐阅读
相关标签
  

闽ICP备14008679号