Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode does not show errors before building

I use VSCode(code editor, not IDE) for C++ with only Microsoft's C++ extension and today I have encountered a problem here. When I write the wrong syntax, the "PROBLEMS" panel does not show errors. It only shows errors on building the code. Earlier that wasn't the case. How do I fix this ?

Before building: enter image description here

After building: enter image description here

enter image description here

like image 848
DivijM Avatar asked Aug 23 '26 13:08

DivijM


2 Answers

I got that error by Disable error squiggles. If you don't reach that error in my case, don't read anymore.

enter image description here

After ignoring, I got your problem:

enter image description here

To fix this, open settings.json file:

enter image description here

Scroll to the end, then set "C_Cpp.errorSquiggles": from Disabled to Enabled. enter image description here

like image 187
Neil Nguyen Avatar answered Aug 25 '26 04:08

Neil Nguyen


After reading the question, and the comments, my understanding is that you want Visual Studio Code to tell you when you make a mistake on the sintax, without having to compile the project.

What could be wrong is your C++ IntelliSense, which is odd because it comes in bundle with the C/C++ extension from Microsoft. The extension itself might be disabled, corrupted during an aborted update, or uninstalled.

Have you tried the good old and helpful uninstall and reinstall the extension? That normally fixes my problems with extensions in Visual Studio and VS Code

like image 29
Alejandro Resendez Avatar answered Aug 25 '26 03:08

Alejandro Resendez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!