赞
踩
编辑系统环境变量: Path 饱含 C:\MinGW\bin
C:\Users\admin>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-9.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-static --enable-shared --enable-threads --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libgomp --disable-libvtv --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --disable-build-format-warnings --prefix=/mingw --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --enable-nls --with-pkgversion='MinGW.org GCC Build-2'
Thread model: win32
gcc version 9.2.0 (MinGW.org GCC Build-2)
新建 my.c
#include <stdio.h>
int main () {
printf("Hello World!");
return 0;
}
编译链接 gcc my.c
指定文件名 gcc my.c -o my.exe
解决中文乱码 gcc -fexec-charset=GBK -finput-charset=UTF-8 my.c -o my.exe
多文件编译链接 gcc -fexec-charset=GBK -finput-charset=UTF-8 index.c my.c -o my.exe
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。