Hello everyone!
I have troubles with VS Code. When I open a C++ class (MovingPlatform) in VS Code, it says that it cannot open source file sal.h and also highlights several parts of code as errors. When I tried to open the same file in Visual Studio 2022 everything worked good, so the code itself contains no errors and all the files seem to be okay, since everything compiled fine with Visual Studio 2022 (using Live Coding function in UE5.3). I would completely swith to VS 2022 instead of VS Code, but in the course that I’m in everything is done with VS Code, so it’s better for the learning process to stick to VS Code.
I’ve tried to uninstall VS Code completely (including folders in appdata\roaming and .code folder).
Please help me resolve this issue, so that I could get back to learning to code
- What version of Unreal are you using?
- Could you show what’s in the c_cpp_properties.json under the .vscode folder?
Surely!
-
I’m using Unreal Engine 5.3.2.
-
Here’s the content of the .json file:
{“configurations”: [
{ "name": "ObstacleAssaultEditor Editor Win64 Development (ObstacleAssault)", "compilerPath": "D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\Hostx64\\x64\\cl.exe", "cStandard": "c17", "cppStandard": "c++20", "intelliSenseMode": "msvc-x64", "compileCommands": "D:\\Unreal Projects\\OAssault\\ObstacleAssault\\.vscode\\compileCommands_ObstacleAssault.json" }, { "name": "Win32", "compilerPath": "D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\bin\\Hostx64\\x64\\cl.exe", "cStandard": "c17", "cppStandard": "c++20", "intelliSenseMode": "msvc-x64", "compileCommands": "D:\\Unreal Projects\\OAssault\\ObstacleAssault\\.vscode\\compileCommands_Default.json" }
],
“version”: 4
}
Presumably you have followed the instructions on downgrading MSVC due to the issues caused by 14.39?
Change the compiler path that’s listed there to the 14.38 version of cl.exe and see if that helps.
I’ve tried installing other versions of Visual Studio Code, but I have not seen a 14.38 version of it on their website. Could you please send the link to these instructions?
To be clear, I’m not telling you to install that. You said everything is working with Visual Studio and you’re using Unreal 5.3 which has problems with the current latest version of MSVC that is installed with it 14.39, you’d be unable to build. So you must already have a different version installed that you’re using.
See:
I’m saying to change the compiler path in that JSON file to be the version that Unreal is using to compile the code. As it currently using the path to the buggy 14.39 compiler.
I’ve made the changes in the .json file, now the path is correct. However, the issue is still there.
Here’s the code from from .json file and some screenshots.
{
“configurations”: [
{
“name”: “ObstacleAssaultEditor Editor Win64 Development (ObstacleAssault)”,
“compilerPath”: “D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\cl.exe”,
“cStandard”: “c17”,
“cppStandard”: “c++20”,
“intelliSenseMode”: “msvc-x64”,
“compileCommands”: “D:\Unreal Projects\OAssault\ObstacleAssault\.vscode\compileCommands_ObstacleAssault.json”
},
{
“name”: “Win32”,
“compilerPath”: “D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\cl.exe”,
“cStandard”: “c17”,
“cppStandard”: “c++20”,
“intelliSenseMode”: “msvc-x64”,
“compileCommands”: “D:\Unreal Projects\OAssault\ObstacleAssault\.vscode\compileCommands_Default.json”
}
],
“version”: 4
}
Could you show the full output of compilation please?