Hello, every time I create new C++ class, Visual studio have problems with all include paths -
[4/3/2024, 8:38:09 PM] "Tower.cpp" not found in "D:\Unreal Projects\ToonTanks\.vscode\compileCommands_Default.json". 'includePath' from c_cpp_properties.json in folder 'TOONTANKS' will be used for this file instead.
I had this situation with Tank.ccp/.h, Tower.ccp/.h, and few times in previous tutorials I tried rebuilding the project with “ToonTanksEditor Win64 Development Build” and restarting Visual Studio Code - with no luck, only thing that helps me was “Refreshing Visual Studio Project” but that’s kinda problematic to do every time I want to add new class is there anything I can do with it?
For a test I added another C++ class “Test” and it has same problems, I think problem might be that compileCommands_toonTanks.json doesnt, get updated:
[
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\BasePawn.cpp",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\BasePawn.h",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\Tank.cpp",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\Tank.h",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\ToonTanks.Build.cs",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\ToonTanks.cpp",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\ToonTanks.h",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\Tower.cpp",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
},
{
"file": "D:\\Unreal Projects\\ToonTanks\\Source\\ToonTanks\\Tower.h",
"arguments": [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\\cl.exe",
"@D:\\Unreal Projects\\ToonTanks\\.vscode\\compileCommands_ToonTanks\\ToonTanks.1.rsp"
],
"directory": "D:\\EpicGames\\UE_5.3\\Engine\\Source"
}
]
Oh I almost forget I use Visual Studio Code version 1.87.2 and UE 5.3.2.
I’ve also checked that in UE my editor is set correctly:
And this is outcome of LiveCoding after creating new class:
Manual recompile triggered
---------- Creating patch ----------
Running D:\EpicGames\UE_5.3\Engine\Build\BatchFiles\Build.bat -Target="ToonTanksEditor Win64 Development -Project=""D:/Unreal Projects/ToonTanks/ToonTanks.uproject""" -LiveCoding -LiveCodingModules="D:/EpicGames/UE_5.3/Engine/Intermediate/LiveCodingModules.json" -LiveCodingManifest="D:/EpicGames/UE_5.3/Engine/Intermediate/LiveCoding.json" -WaitMutex -LiveCodingLimit=100
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -Target="ToonTanksEditor Win64 Development -Project=""D:/Unreal Projects/ToonTanks/ToonTanks.uproject""" -LiveCoding -LiveCodingModules="D:/EpicGames/UE_5.3/Engine/Intermediate/LiveCodingModules.json" -LiveCodingManifest="D:/EpicGames/UE_5.3/Engine/Intermediate/LiveCoding.json" -WaitMutex -LiveCodingLimit=100
Log file: C:\Users\igord\AppData\Local\UnrealBuildTool\Log.txt
Invalidating makefile for ToonTanksEditor (source file added)
Parsing headers for ToonTanksEditor
Running Internal UnrealHeaderTool "D:\Unreal Projects\ToonTanks\ToonTanks.uproject" "D:\Unreal Projects\ToonTanks\Intermediate\Build\Win64\ToonTanksEditor\Development\ToonTanksEditor.uhtmanifest" -WarningsAsErrors -installed
Total of 3 written
Reflection code generated for ToonTanksEditor in 1.1652633 seconds
Building ToonTanksEditor...
Using Visual Studio 2022 14.37.32825 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[Upgrade]
[Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
[Upgrade] IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_0
[Upgrade] Suppress this message by setting 'IncludeOrderVersion = EngineIncludeOrderVersion.Latest;' in ToonTanksEditor.Target.cs.
[Upgrade] Alternatively you can set this to 'EngineIncludeOrderVersion.Latest' to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
[Upgrade]
Determining max actions to execute in parallel (8 physical cores, 16 logical cores)
Executing up to 8 processes, one per physical core
------ Building 3 action(s) started ------
[1/3] Compile [x64] ToonTanks.init.gen.cpp
[2/3] Compile [x64] Test2.gen.cpp
[3/3] Compile [x64] Test2.cpp
Total time in Parallel executor: 0.61 seconds
Total execution time: 4.06 seconds
File D:\Unreal Projects\ToonTanks\Intermediate\Build\Win64\x64\UnrealEditor\Development\ToonTanks\Test2.cpp.obj was modified or is new
File D:\Unreal Projects\ToonTanks\Intermediate\Build\Win64\x64\UnrealEditor\Development\ToonTanks\Test2.gen.cpp.obj was modified or is new
File D:\Unreal Projects\ToonTanks\Intermediate\Build\Win64\x64\UnrealEditor\Development\ToonTanks\ToonTanks.init.gen.cpp.obj was modified or is new
Building patch from 3 file(s) for Live coding module D:\Unreal Projects\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.dll
Creating library D:\Unreal Projects\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.patch_1.lib and object D:\Unreal Projects\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.patch_1.exp
Successfully linked patch (0.000s)
Patch creation for module D:\Unreal Projects\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.dll successful (0.000s)
---------- Finished (0.000s) ----------