如何在 Ubuntu 12.10 (Quantal Quetzal) 中使用 C++ 安装 Eclipse?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14721514/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 18:38:08  来源:igfitidea点击:

How do I install Eclipse with C++ in Ubuntu 12.10 (Quantal Quetzal)?

c++eclipseubuntuinstallation

提问by stenci

I just installed Ubuntu 12.10, and I tried to install Eclipse and C++, but I failed miserably.

我刚刚安装了 Ubuntu 12.10,我尝试安装 Eclipse 和 C++,但我失败了。

I started with an installation from the Software Center, Eclipse worked, but only in Java. Then I started googling for installation guides and tutorials, but after hours of downloads and installations, the C++ in Eclipse still doesn't work.

我从软件中心开始安装,Eclipse 可以工作,但仅限于 Java。然后我开始在谷歌上搜索安装指南和教程,但经过数小时的下载和安装,Eclipse 中的 C++ 仍然不起作用。

So now I have two questions:

所以现在我有两个问题:

  1. How do I clean up this mess?
    Actually, how do I know if there is a mess?
    According to the Ubuntu Software Center, Eclipse is installed and has three add-ons.
    How do I know if the other installations of other Eclipse versions/packagings overwrote each other or if I have multiple installations?

  2. How do I install the latest version of Eclipse and C++ in Ubuntu 12.10?

  1. 我该如何清理这个烂摊子?
    其实,我怎么知道有没有乱七八糟的?
    根据 Ubuntu 软件中心,Eclipse 已安装并具有三个附加组件。
    我如何知道其他 Eclipse 版本/包的其他安装是否相互覆盖,或者我是否有多个安装?

  2. 如何在 Ubuntu 12.10 中安装最新版本的 Eclipse 和 C++?

回答by us2012

There is a package called eclipse-cdtin the Ubuntu 12.10 repositories, this is what you want. If you haven't got g++already, you need to install that as well, so all you need is:

eclipse-cdtUbuntu 12.10 存储库中有一个包,这就是您想要的。如果您还没有g++安装,则还需要安装它,所以您只需要:

sudo apt-get install eclipse eclipse-cdt g++

sudo apt-get install eclipse eclipse-cdt g++

Whether you messed up your system with your previous installation attempts depends heavily on how you did it. If you did it the safe way for trying out new packages not from repositories (i.e., only installed in your home folder, no sudos blindly copied from installation manuals...) you're definitely fine. Otherwise, you may well have thousands of stray files all over your file system now. In that case, run all uninstall scripts you can find for the things you installed, then install using apt-getand hope for the best.

您之前的安装尝试是否弄乱了您的系统,这在很大程度上取决于您是如何做到的。如果您以一种安全的方式尝试不是来自存储库的新软件包(即,仅安装在您的主文件夹中,而不是sudo从安装手册中盲目复制......),那么您绝对没问题。否则,您现在的文件系统中很可能有数千个杂散文件。在这种情况下,运行您可以找到的所有卸载脚本,然后安装使用apt-get并希望最好。

回答by Eric

I used (the suggested answer from above)

我使用了(上面的建议答案)

sudo apt-get install eclipse eclipse-cdt g++

but ONLY after then also doing

但只有在那之后也做

sudo eclipse -clean

Hope that also helps.

希望这也有帮助。

回答by L30nardo SV.

I also tried http://www.eclipse.org/cdt/in Ubuntu 12.04.2 LTS and works fine!

我还在Ubuntu 12.04.2 LTS 中尝试了http://www.eclipse.org/cdt/并且工作正常!

  1. First, I downloaded it from www.eclipse.org/downloads/, choosing Eclipse IDE for C/C++ Developers.
  2. I save the file somewhere, let′s say into my home directory. Open a console or terminal, and type:

    >>cd ~; tar xvzf eclipse*.tar.gz;

  3. Remember for having Eclipse running in Linux, it is required a JVM, so download a jdk file e.g jdk-7u17-linux-i586.rpm (I cann′t post the link due to my low reputation) ... anyway

  4. Install the .rpm file following http://www.wikihow.com/Install-Java-on-Linux

  5. Find the path to the Java installation, by typing:

    >>which java

  6. I got /usr/bin/java. To start up Eclipse, type:

    >>cd ~/eclipse; ./eclipse -vm /usr/bin/java

  1. 首先,我从 www.eclipse.org/downloads/ 下载它,选择 Eclipse IDE for C/C++ Developers。
  2. 我将文件保存在某个地方,比如说到我的主目录中。打开控制台或终端,然后键入:

    >>cd ~; tar xvzf eclipse*.tar.gz;

  3. 记住在Linux上运行Eclipse,它需要一个JVM,所以下载一个jdk文件,例如jdk-7u17-linux-i586.rpm(由于我的声誉低,我无法发布链接)......无论如何

  4. 按照http://www.wikihow.com/Install-Java-on-Linux安装 .rpm 文件

  5. 通过键入以下内容找到 Java 安装的路径:

    >>which java

  6. 我得到了/usr/bin/java。要启动 Eclipse,请键入:

    >>cd ~/eclipse; ./eclipse -vm /usr/bin/java

Also, once everything is installed, in the home directory, you can double-click the executable icon called eclipse, and then you′ll have it!. In case you like an icon, create a .desktop file in /usr/share/applications:

另外,所有东西都安装好后,在home目录下双击名为eclipse的可执行图标,就可以了!如果您喜欢某个图标,请在 /usr/share/applications 中创建一个 .desktop 文件:

>>sudo gedit /usr/share/applications/eclipse.desktop

The .desktop file content is as follows:

.desktop 文件内容如下:

[Desktop Entry]  
Name=Eclipse  
Type=Application  
Exec="This is the path of the eclipse executable on your machine"  
Terminal=false 
Icon="This is the path of the icon.xpm file on your machine"  
Comment=Integrated Development Environment  
NoDisplay=false  
Categories=Development;IDE  
Name[en]=eclipse.desktop  

Best luck!

好运!

回答by Janeway

I was in the same boat. Installed Eclipse, realized need CDT.

我在同一条船上。安装Eclipse,实现需要CDT。

sudo apt-get install eclipse eclipse-cdt g++

sudo apt-get install eclipse eclipse-cdt g++

This just adds the CDT package on top of existing installation - no un-installation etc. required.

这只是在现有安装之上添加 CDT 包 - 无需卸载等。

回答by jasonshao

http://www.eclipse.org/cdt/^Give that a try

http://www.eclipse.org/cdt/^试试看

I have not used the CDT for eclipse but I do use Eclipse Java for Ubuntu 12.04 and it works wonders.

我没有将 CDT 用于 Eclipse,但我确实在 Ubuntu 12.04 中使用了 Eclipse Java,它的效果非常好。