mingw下载后 #include <iostream> using namespace std; int main(int argc,const char* argv[]){ cout<<"中文测试/n"; return 0; } 结果输出乱码,原来是一个参数没有写 g++ -fexec-charset=GBK -Wl,--enable-auto-import helloworld.cpp ok这样输出就没有问题了。