美文网首页
windows下命令行编译C程序

windows下命令行编译C程序

作者: 客昂康 | 来源:发表于2020-11-03 10:49 被阅读0次

已安装VS2019,以hello.c为例,编译步骤如下:

#include <stdio.h>

int main(int argc, char* argv[]){
    printf("hello world ...\n");
    return 0;
}

  1. 打开 x64 Native Tools Command Prompt for VS 2019 Preview("开始"->"Visual Studio 2019"->"Visual Studio 2019"->"VC"->"x64 Native Tools Command Prompt for VS 2019 Preview"),进入"hello.c"所在目录。
  2. 执行 cl hello.c 即可。
  3. 关于 cl 编译器的详细用法,可以执行 cl /? 来查看。

相关文章

网友评论

      本文标题:windows下命令行编译C程序

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