ADM-201 dump PMP dumps pdf SSCP exam materials CBAP exam sample questions

《卷轴教程之C++入门》#1 安装Eclipse CDT和MinGW – 译学馆
未登陆,请登陆后再发表信息
最新评论 (0)
播放视频

《卷轴教程之C++入门》#1 安装Eclipse CDT和MinGW

Installing Eclipse CDT and MinGW

这段视频中我们将要安装和配置C++编程工具
In this video we’re going to set up the tools for C++ programming.
现在 让我们来看看搭建编译环境所需的工具
Ok, so let’s take a look at the tools we’ll need to set up our programming environment.
这是在Windows系统下的操作说明
Now this is going to be explained from the standpoint of a Windows system,
如果你用的是Mac/Linux/Unix操作系统
but if you’re using Mac OS 10 or Linux/Unix,
那么你可以忽略少许的步骤
you can just ignore a few of these steps.
首先我们要下载Eclipse这个软件
So the first thing we’ll do is download Eclipse,
它能为我们提供免费的集成开发环境
which is freely available integrated development environment.
但不幸的是 Eclipse却没有内置C/C++的编译器
Unfortunately it doesn’t have a C or C++ compiler built into it,
这也就是我们不得不下载MinGW的原因
so that’s the reason why we need to download MinGW,
当然 MinGW也是免费的
it’s also freely available.
现在让我们来看看Eclipse
Then we’ll look at installing Eclipse,
以及MinGW的安装
installing MinGW.
此外 为了得到MinGW工具箱的Path信息
Then we’ll need to alter our path environment variable in Windows,
安装完成以后还需要设置环境变量
in order to get some path information there to the MinGW toolset.
最后呢 我们会运行一个简单的程序来校验安装结果
And then finally, we’ll need to verify our installation by running a simple programme.
这里有Eclipse和MinGW的下载链接
Ok, so we have some links here to both Eclipse and MinGW.
如果你打算在Windows系统上安装Eclipse
If you’re going to be installing Eclipse on a Windows system,
我推荐你下载32位版本
I’d recommend getting the 32 bit version.
因为64位版本存在着一些已知的bug
There’s been some known bugs with the 64 bit version,
当你观看这段视频的时候 或许这些bug已经被修复了
those may be resolved by the time that you watch this video,
不过我的推荐还是下载32位版本
but my recommendation would just be to download the 32 bit version.
呃 如果你想在Mac/Linux/Unix系统上运行Eclipse
Eh, if you’re going to be running on Mac OS 10 or Linux/Unix system,
那么你可以忽略MinGW的下载以及配置
you could ignore downloading the MinGW.
安装Eclipse
Installing Eclipse
好的 现在开始安装Eclipse
Ok, let’s take at installing Eclipse.
我已经把ZIP(压缩)文件下载到”Downloads”目录了
I’ve already downloaded the zip file to my Downloads directory,
所以现在我只需要点开”Windows Explorer”
so I’m going to go here, to ‘Windows Explorer’,
然后点击”Downloads”
and then to ‘Downloads’,
这个ZIP文件就是eclipse了
and here’s the zip file that has Eclipse.
现在用鼠标双击左键打开它
So I’m going to double click on it,
然后选中eclipse这一目录
and then select ‘eclipse’,
接着点击”Extract All Files”
and then click on ‘Extract All Files’.
在这里我改变了解压路径
And I’m going to just change the path here,
去掉冗长的部分 直接改到了C盘之下
so that it goes directly into the C directory.
然后点击”Extract”
And then click on ‘Extract’.
解压文件需要花费一点点时间
So, it may take a little while to extract the files,
这个文件大约是120MB
it’s about 120 megabytes in size.
到这里Eclipse就安装完成了
Ok, so Eclipse is finished installing.
现在我们要检验一下安装结果
And we can verify that our installation was okay by going to the eclipse directory,
打开eclipse这个目录 然后点击这里的eclipse.exe
and then clicking on ‘eclipse.exe (executable)’ here.
如果这里弹出了一个安全警告窗口
And if you get a pop up here for security warning,
你可以反选这个复选框 这由你决定
you can remove the checkbox if you like.
接着鼠标点击”Run”(运行)
Go ahead and click on ‘Run’.
每当你启动Eclipse的时候
Alright, so whenever you launch Eclipse,
它总是会提示你去选择一个工作区
it’s going to ask you to select a workspace.
工作区就是当你进行程序开发的时候
So this is going to be where you store your various projects and programmes,
用来存储你的大量程序和项目的地方
whenever you start development.
呃 你可以使用这个默认值 也可以更改 随你喜欢
Eh, you can choose the default or you can change it up, if you like.
我把这个改成了cplusplus
I’m going to change mine to ‘cplusplus’.

Em…
这C++工作区路径和eclipse的路径是不一样的
So I have a different directory there’s for my C++ work.
接着点击”OK”
Then go ahead and click on ‘OK’.
看起来我们已经成功完成安装了
Alright, so looks like our installation of Eclipse was okay,
我们一会儿再校验一下
we’ll come back and further verify this.
安装MinGW
Installing MinGW
好的 现在让我们看看MinGW的安装
Now let’s look at installing MinGW.
我已经把安装包保存到”Download”目录
Already have the installation files saved in my downloads directory.
现在打开”Windows Explorer”
So let’s go to ‘Windows Explorer’,
然后打开”Downloads”文件夹
then ‘Downloads’,
这个就是MinGW可执行文件了
and here we have the MinGW executable.
现在双击打开它
So go ahead and double click on it.
点击”Run”
Click on ‘Run’,
点击”Next”
click ‘Next’,
再次点击”Next”
click ‘Next’ again.
在这个用例中我们选择”use the pre-packaged repository catalogues”
In this case we’ll use the pre-packaged repository catalogues.
然后点击”Next”
So click on ‘Next’.
从头到尾阅读许可证协议
Read through the licence agreement,
如果你同意接受这些条款 点击”I accept the agreement”
if you accept the terms, go ahead and click on ‘I accept the agreement’.
然后点击”Next”
Click ‘Next’,
这里我们使用默认的安装路径
here we’ll keep the default installation path,
不过如果你更喜欢修改它 也是可以的 接着点击”Next”
But if you prefer to change that, you can, click ‘Next’.
在这里我们也选择默认设置 然后点击”Next”
Ugh we’ll keep the default here as well, so click ‘Next’.
这里的”C++ Compiler”一定要确定自己已经选中了
Here we’ll make sure we click on the ‘C++ Compiler’,
到这儿 这是本视频的一个主要事件
that’s the main thing that we’re looking for here.
选择这个”MSYS Basic System” 这也是我们需要的
We’ll also want to select the ‘MSYS Basic System’, we need that as well.
然后点击”Next” 最后点击”Install”
Click ‘Next’ and then finally click ‘Install’.
这个安装可能会需要花费一点点时间
So this may take a little bit of time to install,
一旦安装完成了 立即回来观看如何配置环境
but once we have it, we’ll come back and look at configuring our environment.
变更Windows Path环境变量
Altering Windows Path Environment Variable
好的 既然Eclipse和MinGW已经安装好了
Ok, now that we have Eclipse and MinGW installed,
那么现在我们需要添加一些东西到环境变量
we’ll need to add a couple of things to our environment path.
这是必要的步骤 用来获得C++编译器 C++标准库
This is needed so we can gain access to the C++ Compiler, the C++ standard library,
安装好的MinGW以及一些其他工具的使用权
and some of the other in tools we install with MinGW.
看这里的”Start”按钮
Lets go over here to the ‘Start’ button,
左键单击
left click on it.
然后向上找到”Computer”
And go up to ‘Computer’,
右键单击
right click on that.
然后最下方左键单击”Properties”
And then over and left click on ‘Properties’.
现在打开”Advance system settings”
Now you want to select ‘Advance system settings’,
然后点击”Environment variables”
and then click on ‘Environment variables’.
在”System variables”下面 向下滚动滚动条
So here under ‘System variables’, we’ll scroll down,
来到”Path”这里
and come to ‘Path’,
然后通过点击”Edit”来编辑”Path”
and then edit the ‘Path’ by clicking on ‘Edit’.
现在把光标移到Path框的起始位置
Now I go to the very beginning of the path.
然后输入 C 冒号 反斜线 MinGW 反斜线 bin
And type in ‘C colon slash MinGW slash bin’,
这是我们需要添加到Path的第一个路径
that’s the first thing that we need to add to the path.
然后在末尾添加分号
Then semicolon,
再然后 我们需要再一次输入
and then we need to type in
C 冒号 反斜线 MinGW
‘C, colon, slash, MinGW’ again,
反斜线 msys 反斜线
then ‘slash, msys, slash’
1.0 反斜线 bin 分号
‘1.0, slash, bin, semicolon’.
好的 在Path里又添加了一个路径
Ok, again these things are needed to be added into the path,
之后我们就能使用MinGW的工具了
so we can access those tools from MinGW.
继续 单击”OK”
Go ahead and click on ‘OK’.
再次单击”OK”
Click on ‘OK’ again,
还是”OK”
click on ‘OK’,
现在可以关闭这个窗口了
and you can close out of this.
这样就完成了Path的配置
And you’re done.
校验安装
Verifying Installation
好的 我们现在需要做的最后一件事就是
Ok, the last thing that we’ll want to do,
在任务栏创建一个Eclipse的快捷方式
is create a shortcut on our taskbar to be able to access Eclipse,
然后如果你想要校验一下安装结果 可以编译运行一个程序
and then also if you’ll want to verify that Eclipse can compile and run a programme.
好 让我们打开”Windows Explorer”
So let’s go over here to ‘Windows Explorer’,
打开我们的C盘
go to our C drive,
打开eclipse文件夹
go to ‘eclipse’,
然后选中”eclipse.exe”
and then we’ll select ‘eclipse.exe’.
右键单击
Right click on it,
然后选择固定到任务栏
and then select ‘Pin to Taskbar’.
现在屏幕下方应该有一个Eclipse的小图标了
So now we should have a little icon down here for Eclipse.
以后你可以通过左键单击来快速启动Eclipse
You can left click on it.
如果我现在启动Eclipse
If I launch Eclipse,
那么现在就要用到之前设置好的工作区了
we’ll use our workspace that we set up before.
单击”OK”
Click on ‘OK’.
好的 现在Eclipse已经打开了 点击这里的”File”
And now once we’re inside of Eclipse, we’ll go here to ‘File’,
然后选择”New”
then select ‘New’,
再然后选择”C++ Project”
and then we’ll select ‘C++ Project’.
在这里呢 我们输入一个项目名称 “Test”
Once here, we’ll type in a name for a new project, ‘Test’,
然后看这里 选中”Hello World C++ Project”
and then come here and select ‘Hello World C++ Project’,
工具链这里应该是MinGW GCC
and the toolchains should be ‘MinGW GCC’.
一定要把它们选中
So make sure those are selected.
然后单击”Finish”
Go ahead and click on ‘Finish’.
到现在就基本完成了
And once you’ve done that,
你现在可以单击这里的”Compile”按钮
you should be able to come up here and click on the ‘Compile’ button,
就是这个看起来像锤子的按钮
which would be, look like a hammer.
校验的结果应该是没有任何错误
And verify that you don’t get any sort of errors.
现在我们向下看 确实没有错误
So if we look down here we have no errors.
好的 现在点击这里的”Run”按钮
And now we’ll come here and click on the ‘Run’ button,
这个含有白色三角形的播放按钮就是”Run”按钮
so the ‘Run’ buttons is the screen button with a white triangle.
左键单击
Left click on it.
如果我们看下方的”Console”标签
And if we look down here at our console tab,
这里应该有”Hello World”
we should have ‘Hello World’,
这个校验结果就说明编译器一切工作正常
and that verifies that everything is working correctly.
依据Eclipse的安装
In terms of our Eclipse installation,
他们现在就能使用 或者说是充分利用
they were able to access and make use of
MinGW GCC编译器了
the MinGW GCC Compiler.
好的 看样子每一处效果都不错
And everything seem to be working well.

发表评论

译制信息
视频概述

C++入门修炼教程#1 编译器安装及配置

听录译者

positiveme

翻译译者

[B]Azrael

审核员

知易行难

视频来源

https://www.youtube.com/watch?v=rgt3PJ5DvH4

相关推荐