Yes! Compiled language! With the coming of Code Runner extension, we could run many interpreted language directly in VS Code without any configuration. And now, running compiled language (currently C, C++, Java) is supported by Code Runner! Many thanks to the contribution of @manoelcampos.
With support of running compiled language, Code Runner now supports 24 languages: C, C++, Java, JS, PHP, Python, Perl, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F#, C#, VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml
The default configuration for C, C++, Java are as below.
"code-runner.executorMap": {
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "gcc $fullFileName && ./a.out",
"cpp": "g++ $fullFileName && ./a.out",
}
As you could see, several placeholders are supported in configuration:
- $dir: The directory of the code file being run
- $fullFileName: The full name of the code file being run
- $fileName: The base name of the code file being run, that is the file without the directory
- $fileNameWithoutExt: The base name of the code file being run without its extension
You are free to update or add configuration to support more languages. Come and send a Pull Request for us!
One example configuration for C/C++ for Windows using MinGW (gcc/g++) is:
“code-runner.executorMap”: {
…
“c”: “gcc -o $fileNameWithoutExt $fullFileName && $fileNameWithoutExt”,
“cpp”: “g++ -o $fileNameWithoutExt $fullFileName && $fileNameWithoutExt”
}
This will both compile and run the file afterwards. If your file’s name is “Program” (Program.cpp), the output will be Program.exe.
LikeLike
Cool! You got it!
LikeLike
Thanks!
Could you add a tool what we can see the output?
LikeLike
Hi Vincent, it is already showing the output. What issue do you meet with?
LikeLike
http://luhadm.ru/bitrix/rk.php?goto=https://tubegalore.site/
LikeLike
Hello to all, it’s in fact a good for me to go to see this web page, it includes useful Information.|
LikeLike
I was wondering if you ever thought of changing the page layout of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 images. Maybe you could space it out better?|
LikeLike