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

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

问题描述

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



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



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



我有eclipse helios,想要使用它来编写C ++,但我一直运行到启动失败,二进制未找到错误。



使用mingw-get-inst-20120426文件安装了MingW C ++编译器,并选择了C编译器,C ++编译器,MSYS基本系统和Mi​​ngW开发工具包。



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



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



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



但是,一旦我运行HelloWorld程序,它会获得启动失败。 Binary Not Found错误。



这里是另一个错误:
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 ++ Development Tooling),并将features和plugins eclipse文件夹。



有人可以一步一步地解决这个问题吗?

解决方案

首先,在下面的示例中,所有驱动器号都应该替换为系统上的相关代码。不是全部 真的必要,但它的工作原理(和更多的乐趣)。



我们从稍微简单的发布配置开始 - 我们想要编译。



转到项目 - 属性



查看include目录是否正确。 / p>

>



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



设置为发布并浏览到发布项目的文件夹。如果exe文件的名称中没有设置类型。





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





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



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

工具 - GCC C ++编译器



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





右键单击项目,然后查看 - Build Configurations - Set Active - Release。



右键单击项目 - Run As - Run Configurations 。



在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天全站免登陆