2

enter image description here

Error messages are:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\DINO\code\pong\pong.cc).C/C++(1696)

cannot open source file "crtdbg.h" (dependency of "iostream")C/C++(1696)

I used to solve this issue, but it just comes once again.

I have searched, but they don't work..

Also, I wonder when clicking run, is it normal to have

bash: cd: d:\DINO\code\pong" && g++ pong.cc -o pong && d:DINOcodepong"pong: No such file or directory

in the Code terminal and we need to manually compile it with g++, rather than VS Code done that for us, while in bash there's no this error?

Thank you for any help.

KOMAX233
  • 53
  • 7
  • 2
    have you followed the [documentation](https://code.visualstudio.com/docs/languages/cpp)? – Alan Birtles Sep 23 '21 at 20:26
  • 2
    If your `bash` is anything like normal `bash`, the backslashes aren't directory separators. Replace them with `/` – Ted Lyngmo Sep 23 '21 at 20:28
  • 1
    Alan! For crying out loud! Are you trying to put us out of work? If people actually read the ing manual, none of us would have jobs. Stop giving away the great trade secrets! – user4581301 Sep 23 '21 at 20:28
  • 1
    As @TedLyngmo said the problem is using the wrong path separator for the bash shell. I am not sure how to have VS Code generate paths for bash. You may want to switch to using powershell or cmd.exe if you can't find the setting. Edit: this may help: [https://stackoverflow.com/a/62672082/487892](https://stackoverflow.com/a/62672082/487892) – drescherjm Sep 23 '21 at 20:52

1 Answers1

1

I've solved the include problem by watching this.

I pasted the mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0 to the includePath, mingw64\bin\g++.exe to the complierPath, modified all \ to \\, followed instructions from vs code output, and the error just disappeared!

KOMAX233
  • 53
  • 7