I cant compile due to a .json error any fixes

i dont know how to fix this can anyone help?

That is not showing any compilation errors. You should be able to solve the issue of the red squiggles by doing Tools > Refresh VS Code project within Unreal.

1 Like

That didn’t change anything it still doesn’t work.

That worked for me at least ! :grinning_face_with_smiling_eyes:

Would you mind showing your compilation error message?

This isn’t an error, more just an informational message that will annoyingly spam you. But to fix it, this is what I did and it seemed to not mess anything up. This is not necessary to complete the project, more just to stop getting spammed and answer your question.

On the Explorer for VSCode while having CryptRaider open, you will see the nested file “CryptRaider.vscode\compileCommands_Default.json”. Click to open that file.

Example:

Now it will list several lines in this order {file, command, directory}. Put a comma next to the last brace. Grab everything between one set of the braces { }, and paste it right below.

Change the filename for “file”: to “Movers.cpp”. In my case, mine is Mover.cpp but I can see in your info messages you named yours Movers.cpp.

An example image is below, you can see I added lines 67-71.

Now why did this happen? I have been around coding a lot for work, but I’m not as familiar with how this necessarily functions, so this is my best guess:

When the C++ project was made, it already brought in all the default C++ files it knew about (CryptRaider.cpp, CryptRaider.h, CryptRaiderCharacter.cpp, etc) into that json file. When we created a new one (Mover.cpp, Mover.h), it didn’t get added to that json file. But because it is smart, it used the includepath in c_cpp_properties.json (${default}) which is able to find that file. So by adding that file location to the compileCommands_Default.json, you are essentially just telling it where to find the file and which command to run on it like all the other files Unreal made for the project.

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

Privacy & Terms