如何安装C ++插件到Eclipse? [英] How to install C++ plugin to Eclipse?

查看:164
本文介绍了如何安装C ++插件到Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于这个noobish Q,我事先道歉,但是我开始学习C ++,只使用Java。



我也在这里和其他地方搜索了一个解决方案这个并且遵循所有步骤,仍然得到这个错误。



我会尽可能的具体,以帮助你们。



我有eclipse helios,并希望使用C ++编写C ++,但是我继续运行到Launch failed。Binary Not Found错误。



I使用mingw-get-inst-20120426文件安装了MingW C ++编译器,并选择了C编译器,C ++编译器,MSYS Basic系统和Mi​​ngW Developer Toolkit。



然后我去了eclipse>项目>属性> C / C ++常规>路径和符号,然后在包含选项卡中选择GNU C ++,并添加了C:\MinGW\lib\gcc\mingw32\ 4.6.2 \include \c ++路径



我也去了C / C ++ build>环境并附加了C:\MinGW\bin; C :\MinGW\\ \\\\1.0\bin到PATH。



然后我创建了一个Hello World C ++项目,在Toolchains下选择MingW GCC,然后使用锤子图标。



但是,一旦我运行了HelloWorld程序,它会得到启动失败。二进制未找到错误。



这是另一个错误:
g ++ -IC:\MinGW\lib\gcc\mingw32\4.6。 2\include\c ++ -O0 -g3 -Wall -c -fmessage-length = 0 -osrc\HelloWorld.o ..\src\HelloWorld.cpp
内部构建器:无法运行程序g ++ :系统找不到指定的文件。



我还下载了CDT(C / C ++开发工具),并将功能和插件文件夹传输到eclipse文件夹。



有人可以逐步介绍如何解决这个问题吗?

解决方案

首先,在以下示例中,所有驱动器号应替换为系统上的相关文件。不是全部 真的有必要,但它有效(而且更好)。



我们从简单的发布配置开始,我们想让它编译。



转到项目 - 属性



查看包含目录是否正确到位。





转到项目 - 属性 - 运行/调试设置 - - 新建 - 主选项卡



设置为释放并浏览到项目的Release文件夹。如果没有设置exe文件,请输入其名称。





切换到公用选项卡。检查分配控制台并在后台启动。 不要运行。





转到项目 - 属性 - C / C ++构建 - 发现选项



工具 - GCC C ++编译器



浏览到mingw bin文件夹,并选择g ++。exe或复制mingw32-g ++。exe到g ++。exe

注意:图像指向mingw32-g ++。exe请使用 g ++。exe





右键单击项目并查看 - 构建配置 - 设置活动 - 释放已选中。



右键单击项目 - 运行方式 - 运行配置



在C / C ++应用程序选择下,引用发行版本的。然后单击运行



如果这样,我将向您展示如何设置调试属性。 (更复杂)


I apologize beforehand for this noobish Q, but Im starting to learn C++, and have only used Java.

I have also searched here and elsewhere for a solution to this and followed all steps and still getting this error.

I will try to be as specific as I can to help you guys.

I have eclipse helios and wanted to code C++ using it, but I keep running into the "Launch failed. Binary Not found" error.

I installed the MingW C++ compiler using the "mingw-get-inst-20120426" file and selected the "C compiler, C++ compiler, MSYS Basic System, and MingW Developer Toolkit".

Then I went to eclipse > project > properties > C/C++ General > Paths and Symbols, then selected the GNU C++ in the Includes tab and added the "C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++" path

I also went to C/C++ build > Environment and appended the "C:\MinGW\bin;C:\MinGW\msys\1.0\bin" to the PATH.

Then I created a Hello World C++ project, selecting the MingW GCC under Toolchains, and then build the project using the "hammer" icon.

However, once I ran the HelloWorld program it gets the "Launch failed. Binary Not Found" error.

Here is another error: g++ -IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\HelloWorld.o ..\src\HelloWorld.cpp Internal Builder: Cannot run program "g++": The system cannot find the file specified.

I also downloaded the CDT (C/C++ Development Tooling) and transferred the "features" and "plugins" folder to the eclipse folder.

Can someone please give me step-by-step on how to resolve this?

解决方案

Firstly, in the following examples all drive-letters should be replaced with the relevant ones on your system. Not all of these steps are really necessary, but it works (and the more the merrier).

We start with the slightly simpler release config - we want to make it compile.

Go to Project -- Properties

Look if the include directories are correct and in place.

Go to Project -- Properties -- Run/Debug Settings -- NEW -- Main Tab

Set to Release and Browse to the Release folder of the project. If the exe file is not set type in its name.

Switch to Common Tab. Check Allocate Console and Launch in Background. Don't Run yet.

Go to Project -- Properties -- C/C++ Build -- Discovery Options

Tools -- GCC C++ Compiler

"Browse" to the mingw bin folder and select the g++.exe or copy mingw32-g++.exe to g++.exe

Note: The image points to mingw32-g++.exe please use g++.exe

Right click on the project and look -- Build Configurations -- Set Active -- Release is checked.

Right click on the project -- Run As -- Run Configurations.

Under C/C++ Application select, the one which refers to the release version. Then click Run

If this works, I will show you how to set the Debug Properties. (more complicated)

这篇关于如何安装C ++插件到Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆