Fatal error...cannot open source file...No such file or directory (VS Code)

I have been trying to solve this issue for several hours, but now I need the assistance of someone smarter.

Screenshot of my error when I try to run “Hello, world”:

I believe I do everything correctly:

  1. I access VS Code via Developer Command Prompt;
  2. I believe I have everything installed correctly as shown in the screenshots below:

Here is my JSON settings:

You have saved TripleX.cpp in C:/Users/athor/Documents/ however your terminal is in C:/Users/athor/ so just cd to change directory.

cd Documents

And then the compilation command should work.

Thank you for the help, although now I am getting a new error:

Someone suggested I type “cl triplex.cpp/EHsc,” but I get another error when I type that in:

You need a space before the /

Also it’s just a warning which you can ignore.

When I put the space before the “/” I don’t get an error, but the program still does not seem to work properly. Instead, I get this:

That’s the expected output. Compiling creates the program it doesn’t execute it. Just type it’s name “triplex.exe” the “.exe” is optional.

Thank you very much! It works!

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

Privacy & Terms