c/c++的eclipse环境搭建

下载mingw

[下载地址](https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download

解压

解压到d:盘根目录,如图
在这里插入图片描述

环境变量设置

path环境变量追加

;D:\mingw64\bin;

新建C_INCLUDE_PATH环境变量并把值设置为

D:\mingw64\include

新建LIBRARY_PATH环境变量并把值设置为

D:\mingw64\lib

新建CPLUS_INCLUDE_PATH环境变量并把值设置为

D:\mingw64\lib\gcc;D:\mingw64\lib\gcc\x86_64-w64-mingw32;D:\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0;D:\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include;D:\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++;D:\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\backward;

确认安装结果

打开命令行提示符,执行g++ --v,如果能打印出版本号,说明mingw64安装成功
在这里插入图片描述

  • 新建c++源文件
    桌面位置(比如我的是C:\Users\Administrator\Desktop)新建一个文本文件,明明为helloworld.cpp,文件内容填写
#include <iostream>
using namespace std;
int main()
{
	cout<<"hello world"<<endl;
    return 0;
}
  • 编译
    命令行切换到helloworld.cpp所在目录,执行
g++ helloworld.cpp -o helloworld

确认此时该目录是否生成helloworld.exe文件

  • 运行
    命令行切换到helloworld.cpp所在目录,执行
helloworld

确认此时命令行执行结果是否为hello world

在这里插入图片描述

下载Eclipse IDE for C/C++ Developers

https://www.eclipse.org/downloads/packages/

2018-12的版本链接

猜你喜欢

转载自blog.csdn.net/k3108001263/article/details/88636672