美文网首页
Compile & run C program in VScod

Compile & run C program in VScod

作者: Jack_Jiang | 来源:发表于2017-12-03 14:31 被阅读0次

Compiler(GCC)

1. Linux

gcc is built in, type gcc -v to check

2. Windows

you may need to install TDM-GCC

3. Mac

I don't have Mac, hopefully this will work

Editor (VSCode)

1. install code-runner

2. configure code-runner

  • open Files -> Preferences -> Settings
  • search for code-runner
  • change code
    "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    to
    "c": "cd $dir && gcc -Wall -Werror $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
  • change code
    "code-runner.runInTerminal": false
    to
    "code-runner.runInTerminal": true

3. press Ctrl+Alt+N to run code

image.png

相关文章

网友评论

      本文标题:Compile & run C program in VScod

      本文链接:https://www.haomeiwen.com/subject/iuvabxtx.html