Advertisement

SCons教程: 构建第一个程序

阅读量:

构建首个程序实现

使用scons构建hello程序

复制代码
    #include <stdio.h>
    
    int main(void)
    {
    printf("hello\r\n");
    
    return 0;
    }
    
    
      
      
      
      
      
      
      
      
    

SConstruct

复制代码
    Program('hello.c')
    
    
      
    

通过在命令窗口输入 scons 命令,系统将自动完成程序的构建过程,其输出结果如下:

复制代码
    admin@DESKTOP-NQU1HUV C:\Users\admin\Desktop\scons\day1
    $ scons
    scons: Reading SConscript files ...
    scons: done reading SConscript files.
    scons: Building targets ...
    gcc -o hello.o -c hello.c
    gcc -o hello.exe hello.o
    scons: done 

全部评论 (0)

还没有任何评论哟~