VS Code Include Error

Hey there,
Sorry to post this question as Ive seen there are many similar ones but for some reason none of the other fixes worked for me. Just to sum it all up quickly, Im currently trying to code the Building escape game on a MacBook, Ive just jumped back into it after taking a very long break. since the last time Ive used it UE4 has jumped over to Xcode as the default so I switched it back to VS Code due to the lack of autocomplete. however it VS code isn’t making it any easier. Autocomplete is still not working and it is constantly giving me an include error when using -#include “WorldPosition.generated.h”-. Any ideas? I apologise if this question has been answered somewhere else.
Thank you in advance.

What version of Unreal are you using? 4.25.x has issues which were fixed in 4.26.1

Im actually using 4.22.3 to match the videos if I’m not mistaken.

I don’t think that has issues. Have you tried using File > Refresh VS Code Project in Unreal?

Yep tried that, sadly no change. I did however just realise that while I may have created it in 4.22 it actually defaulted to 4.26.1 every time I clicked on it (when opening it from the epic games launcher). So I went ahead and deleted the project to make a new one so I could start it up from the 4.22 launcher itself (and not through the epic games launcher like I used to) but now I’ constantly confronted with this message telling me that the compile failed. Slightly different to my initial question but any ideas how to solve this?

The project could not be compiled. Would you like to open it in Visual Studio Code?


Running Mono...

Found mono via known Mono.framework path
Running installed mono, version:  Mono JIT compiler version 6.8.0.123 (2019-10/1d0d939dc30 Thu Mar 12 23:19:08 EDT 2020)
/Users/Shared/Epic Games/UE_4.22/Engine /Users/Shared/Epic Games/UE_4.22/Engine/Binaries/Mac
Creating makefile for BuildingEscapeEditor (no existing makefile)
@progress push 5%
Parsing headers for BuildingEscapeEditor
  Running UnrealHeaderTool "/Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/BuildingEscape.uproject" "/Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/BuildingEscapeEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
LogMac: Warning: dlopen failed: dlopen(/Users/Shared/Epic Games/UE_4.22/Engine/Binaries/Mac/System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/Current/CoreSymbolication, 5): image not found
Reflection code generated for BuildingEscapeEditor in 7.2341745 seconds
@progress pop
Performing 7 actions (5 in parallel)
[1/7] Compile SharedPCH.Engine.h
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:541:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/StaticMesh.h:23:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:478:24: error: loop variable 'EdgeVertexID' of type 'const FVertexID' creates a copy from type 'const FVertexID' [-Werror,-Wrange-loop-analysis]
                for( const FVertexID EdgeVertexID : Edge.VertexIDs )
                                     ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:478:8: note: use reference type 'const FVertexID &' to prevent copying
                for( const FVertexID EdgeVertexID : Edge.VertexIDs )
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     &
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:550:32: error: loop variable 'VertexInstanceID' of type 'const FVertexInstanceID' creates a copy from type 'const FVertexInstanceID' [-Werror,-Wrange-loop-analysis]
                for( const FVertexInstanceID VertexInstanceID : VertexInstanceIDs )
                                             ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:550:8: note: use reference type 'const FVertexInstanceID &' to prevent copying
                for( const FVertexInstanceID VertexInstanceID : VertexInstanceIDs )
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                             &
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:653:22: error: loop variable 'VertexConnectedEdgeID' of type 'const FEdgeID' creates a copy from type 'const FEdgeID' [-Werror,-Wrange-loop-analysis]
                for( const FEdgeID VertexConnectedEdgeID : VertexArray[ VertexID0 ].ConnectedEdgeIDs )
                                   ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:653:8: note: use reference type 'const FEdgeID &' to prevent copying
                for( const FEdgeID VertexConnectedEdgeID : VertexArray[ VertexID0 ].ConnectedEdgeIDs )
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                   &
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:682:32: error: loop variable 'VertexInstanceID' of type 'const FVertexInstanceID' creates a copy from type 'const FVertexInstanceID' [-Werror,-Wrange-loop-analysis]
                for( const FVertexInstanceID VertexInstanceID : VertexArray[ VertexID ].VertexInstanceIDs )
                                             ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:682:8: note: use reference type 'const FVertexInstanceID &' to prevent copying
                for( const FVertexInstanceID VertexInstanceID : VertexArray[ VertexID ].VertexInstanceIDs )
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                             &
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:695:22: error: loop variable 'EdgeID' of type 'const FEdgeID' creates a copy from type 'const FEdgeID' [-Werror,-Wrange-loop-analysis]
                for( const FEdgeID EdgeID : ConnectedEdgeIDs )
                                   ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/MeshDescription/Public/MeshDescription.h:695:8: note: use reference type 'const FEdgeID &' to prevent copying
                for( const FEdgeID EdgeID : ConnectedEdgeIDs )
                     ^~~~~~~~~~~~~~~~~~~~~~
                                   &
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:553:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Animation/Skeleton.h:16:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Animation/SmartName.h:10:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Core/Public/UObject/AnimPhysObjectVersion.h:49:3: warning: declaration shadows a variable in the global namespace [-Wshadow]
                VersionPlusOne,
                ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/StaticMesh.h:450:2: note: previous declaration is here
        VersionPlusOne,
        ^
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:609:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h:885:3: warning: declaration shadows a variable in the global namespace [-Wshadow]
                Default,
                ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Materials/MaterialFunctionInterface.h:25:2: note: previous declaration is here
        Default,
        ^
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:614:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Components/SkeletalMeshComponent.h:12:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/SkeletalMeshTypes.h:62:3: warning: declaration shadows a variable in the global namespace [-Wshadow]
                VersionPlusOne,
                ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/StaticMesh.h:450:2: note: previous declaration is here
        VersionPlusOne,
        ^
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:614:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Components/SkeletalMeshComponent.h:12:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/SkeletalMeshTypes.h:83:3: warning: declaration shadows a variable in the global namespace [-Wshadow]
                VersionPlusOne,
                ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/StaticMesh.h:450:2: note: previous declaration is here
        VersionPlusOne,
        ^
In file included from /Users/toffeefee8/Documents/Unreal Projects/BuildingEscape/Intermediate/Build/Mac/BuildingEscapeEditor/Development/Engine/SharedPCH.Engine.h:206:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:614:
In file included from /Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Components/SkeletalMeshComponent.h:12:
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Public/SkeletalMeshTypes.h:104:3: warning: declaration shadows a variable in the global namespace [-Wshadow]
                VersionPlusOne,
                ^
/Users/Shared/Epic Games/UE_4.22/Engine/Source/Runtime/Engine/Classes/Engine/StaticMesh.h:450:2: note: previous declaration is here
        VersionPlusOne,
        ^
5 warnings and 5 errors generated.

Currently reloading the engine, hope that will fix it

nope no luck

That is an issue with the Xcode version you are using. Either downgrade Xcode or upgrade to UE 4.26 where this was fixed.

Alright thanks, ill start using the most recent UE engine then. However, if I use Visual studio code, its still giving me those include errors + no autocomplete. And when using Xcode its got no autocomplete and and no syntax/spelling check. Which one should I go for?

4.26.1+ should fix that.

Didn’t fix VS code sadly, still got my hopes up for Xcode, its not working atm but its still indexing so maybe once that’s done it’ll work.

Sorry to ask but is it normal for Xcode to index for this long? its been indexing for 2 days straight and its at like 10%

Sadly Both Xcode and VS code refuse to make life easy, autocomplete doesn’t work on either one of them. Any other fixes?

Not that I’m aware of. I’d suggest you report this to the issues for the vscode-cpptools extension.

Alright, will do, thanks for your time

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.