Hello World Error!

Firs i cant compile the code i writing by typing “cl…” (‘cl’ is not recognized as an internal or external command, operable program or batch file.), and second; when I write “std::count <<…” the program underlines it as error and in problems tab it says: “Mismatch in formal parameter list (C2563)”

Did you open VS Code via the developer command prompt?

It should be cout not count. It stands for character output.

Thanks for correcting my code spelling :sweat_smile:, and yes i opened VS via command prompt, as recommended I pined promt to task bar. I can execute the code by adding .exe at the end of the file name in terminal (which now displace the message thanks!), but cl command won’t work at all. I tried adding .cpp after the file name, tried capital letters, without capitals… I installed VScode 2018 version, but after the update it turned in to 2019, maybe thats the problem??

1 Like

Could you show what you get typing “cl” in the developer command prompt?

Hi GAR, what do you get if you type cl in the Developer Command Prompt per se, before launching VSCode.
Does it return something like that?

So in command promt when I type where cl it comes out with backslashes, so as recommended I added 2nd backslashes to each one, tried removing backlashes and pasting just slashes(/), I tried saving the compiler as "…Hostx64/x64, x86/x64, x64/x86, x86/x86. with/without backslashes.

Yes it comes out almost precisely as your screenshot

Oh, and can you confirm that then you launch VSCode from the Developer Command Prompt like that?

I used native promt, and VScode promt too, I just tipe “code” in it to open VScode. yes i lunch it from “cmd?”…

I experienced something similar to your problem once. I correctly launched VSCode from the Developer Command Prompt but it couldn’t find cl command so I quit VSCode, then I checked for cl command inside the Developer Command Prompt, it was ok, then I relaunched VSCode and now cl TripleX.cpp was working correctly. I couldn’t figure out the reason behind that behaviour though

hmmm thanks for helping hand, you give me enough reason to troubleshoot further :slight_smile:

1 Like

Ok so I found a way to compile the code and run it in the same time by pressing F5. it will NOT work if I do it manually.
Disclaimer F5 command woun’t compile but still run the code if you open VScode in normal CMD, and it will give you same error; “‘cl’ is not recognized as an internal or external command, operable program or batch file.”

1 Like

I think you might have conflated some things?

The article about adding the path for “cl” was for IntelliSense only. It does not allow you to compile without using the developer or native command prompt. Those command prompts setup the environment and VS Code will keep that environment by opening it from those command prompts.

The difference of environment variables:

I would not know, Im a novice I can only follow instructions and try to brute force the solution. Besides it fixed it self, i dont know how ¯_ (ツ)_/¯