vs code 怎么配置编译器呀
怎么样才能直接运行呀网上查了好多都不行 vs code本质上是文本编辑器,要当IDE用要搭配额外的编译器,这个小甲鱼应该有视频:https://www.bilibili.com/video/BV1nt4y1r7Ez windows我可以帮弄mac没玩过 说一下原理下载code runner插件之后可以给任意后缀的语言配置命令 但是这个命令必须有stdout或者stderr
如果你给markdown文件配置一个typora命令 是打不开的 因为它没std输出
settings.json默认配置如下
"code-runner.clearPreviousOutput": true,
//"code-runner.runInTerminal": true, 注意这个 你如果要使用stdin比如c语言的getchar函数 就得开启这个
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", //这个就是你编译并运行c的命令gcc你先得有效
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"php": "php",
"python": "set PYTHONIOENCODING=utf8 && python",
"perl": "perl",
"perl6": "perl6",
"ruby": "ruby",
"go": "go run",
"lua": "lua",
"groovy": "groovy",
"powershell": "powershell -ExecutionPolicy ByPass -File",
"bat": "cmd /c",
"shellscript": "bash",
"fsharp": "fsi",
"csharp": "scriptcs",
"vbscript": "cscript //Nologo",
"typescript": "ts-node",
"coffeescript": "coffee",
"scala": "scala",
"swift": "swift",
"julia": "julia",
"crystal": "crystal",
"ocaml": "ocaml",
"r": "Rscript",
"applescript": "osascript",
"clojure": "lein exec",
"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
"racket": "racket",
"scheme": "csi -script",
"ahk": "autohotkey",
"autoit": "autoit3",
"dart": "dart",
"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
"haskell": "runhaskell",
"nim": "nim compile --verbosity:0 --hints:off --run",
"lisp": "sbcl --script",
"kit": "kitc --run",
"v": "v run",
"sass": "sass --style expanded",
"scss": "scss --style expanded",
"less": "cd $dir && lessc $fileName $fileNameWithoutExt.css"
}
Visual Stidio Code是个编辑器,需要插件 王逗比666 发表于 2021-7-18 13:33
vs code本质上是文本编辑器,要当IDE用要搭配额外的编译器,这个小甲鱼应该有视频:https://www.bilibili.co ...
{:5_106:} kogawananari 发表于 2021-7-18 13:56
说一下原理下载code runner插件之后可以给任意后缀的语言配置命令 但是这个命令必须有stdout或者stderr
...
{:5_104:} 万千只cnm 发表于 2021-7-18 18:33
说白了就是你gcc命令得有效 就像是你运行python需要python命令有效 运行js需要node命令有效
你gcc有效就能运行c和cpp了当然vscode不支持输入windows下ps1命令不支持&&符号导致开启runInTerminal也会报错要修改配置 关掉runInTerminal后还得改回&&{:10_292:}
页:
[1]