编写开发代码

要求:编译时,没有“编译相关的出错和警告”。

main.c 示例代码:打印数字1到100相加的结果

#include <stdio.h>

int main(void)
{
    int i, start = 1, stop = 100, sum = 0;
    for (i = start; i <= stop; i ++)
    {
        sum += i;
    }
    printf(" sum %d to %d equals %d\n", start, stop, sum);
    return 0;
}

IDE 交叉的编译输出

09:34:09 **** Build of configuration Debug for project cc-gdb ****
make all 
Building file: ../main.c
Invoking: Cross GCC Compiler
mips-openwrt-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.c"
mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
Finished building: ../main.c

Building target: cc-gdb
Invoking: Cross GCC Linker
mips-openwrt-linux-gcc  -o "cc-gdb"  ./main.o   
mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
Finished building target: cc-gdb


09:34:09 Build Finished (took 346ms)

results matching ""

    No results matching ""