安裝mingw後,在命令窗體編譯c文件
阿新 • • 發佈:2017-07-29
mpi white har 生成 line ostream min hello urn
1、編譯test.cpp文件
#include<iostream>
int main(int argc,char **argv)
{
std::cout<<"hello"<<std::endl;
return(0);
}
2、在cmd模式下進入test.cpp文件夾
3、編譯。將.cpp文件生成目標文件
g++ -c test.cpp
4、鏈接,將目標文件生成可運行文件
g++ -o test test.o
編譯test.c文件
#include<stdio.h>
int main(int argc,char **argv)
{
printf("hello");
return(0);
}
gcc -c test.c
gcc -o test test.o
在ccd 鍵入mingw-get 進入MinGW Installation Manager 窗體
download and install the C compiler from the command line: mingw-get install gcc
#include<iostream>
int main(int argc,char **argv)
{
std::cout<<"hello"<<std::endl;
return(0);
}
2、在cmd模式下進入test.cpp文件夾
3、編譯。將.cpp文件生成目標文件
g++ -c test.cpp
4、鏈接,將目標文件生成可運行文件
g++ -o test test.o
編譯test.c文件
#include<stdio.h>
{
printf("hello");
return(0);
}
gcc -c test.c
gcc -o test test.o
在ccd 鍵入mingw-get 進入MinGW Installation Manager 窗體
download and install the C compiler from the command line: mingw-get install gcc
安裝mingw後,在命令窗體編譯c文件