OS X Eclipse C ++启动失败 - 找不到二进制 [英] OS X Eclipse C++ Launch Failed - Binary Not Found

查看:477
本文介绍了OS X Eclipse C ++启动失败 - 找不到二进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很担心,因为这不应该让我头疼。我已为MAC OS X 10.7.1 /

I am quite troubled as this shouldn't be causing me such a headache. I've downloaded the most recent Eclipse Indigo and all CDT C++ plugins for MAC OS X 10.7.1/

CDT插件,我开发了一个简单的hello worldc ++应用程序,并试图运行应用程序,启动失败,二进制没有找到。错误信息。我读了多个修复,但没有一个工作。我尝试添加-arch i386标志到链接器和编译器命令,仍然没有运气。

Upon restarting after installing the above CDT plugins, I've developed a simple 'hello world' c++ application and have tried running the application, "Launch failed. Binary not found." error message. I've read multiple fixes but none have worked. I tried adding the -arch i386 flag to the linker and compiler commands, still no luck.

有任何人成功获得Eclipse C ++运行在10.7.1 ?这打击了我的心。我可以简单地写入相同的程序在VIM和编译它只是罚款通过终端和执行很好。 ECLIPSE不想再玩了。

Has anyone successfully gotten Eclipse C++ running on 10.7.1?????? This blows my mind. I can simply write the same program in VIM and compile it just fine via the terminal and execute just fine. ECLIPSE DOESN'T WANT TO PLAY ALONG.

我会非常感激任何可以帮助的人。

I will be deeply indebted to anyone who can help!!!!!

EDIT:编译器输出

**** Build of configuration Debug for project HelloWorld ****
make all Building file: ../main.cpp
Invoking: GCC C++ Compiler g++ -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -arch i386 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: libHelloWorld
Invoking: MacOS X C++ Linker g++ -arch i386 -dynamiclib -o "libHelloWorld" ./main.o
Finished building target: libHelloWorld
**** Build Finished ****


推荐答案

我使用Eclipse Juno和CDT在运行Snow Leopard的2007 Macbook上。我有两个症状:

I am using Eclipse Juno with CDT on a 2007 Macbook running Snow Leopard. I have the two symptoms:


  1. 项目资源管理器中没有二进制文件夹,

  2. 失败。 Binary not found错误。

我花了几个小时在Google上搜索答案,时间长到足以确定这两种症状是指示性的的任何数目的问题,据报道不到十年,没有足够的决议。这是一个问题,因为在十年后,应该有足够多的输入数据,提供一个故障排除程序在某处,用户逐步通过消除所有可能的原因。

I have spent hours searching on Google for an answer, long enough to ascertain that these two symptoms are indicative of any number of problems which have been reported for not quite a decade without adequate resolution. That is a problem right there because after a decade there should have been more than enough input data to provide one troubleshooting procedure somewhere which walks the user step by step through the elimination of all possible causes.

相反,几个小时我已经阅读了很多人,其中许多人已经解决了他们的特定问题,但他们似乎都必须做一些稍微不同的东西到那里。

Instead, for hours I have read about a multitude of people, many of whom have resolved their particular problem but all of them seeming to have had to do something slightly different to get there.

这不应该是很难解决。特别是在我的情况下(但我不是唯一的一个),当控制台视图显示一个没有错误的构建,用户可以复制二进制文件[它奇异地说,它找不到]到桌面,并运行它来自Finder或bash终端会话的任何问题。

This should not be that difficult to resolve. Particularly in cases such as mine [but I am not the only one] when the Console view displays a Build with no errors yet the user can copy the binary file [which Eclipse bizarrely says it can not find] to the Desktop and run it without any problems from either Finder or a bash terminal session.

所有这些似乎都指向了 Mach0 64二进制解析器中缺乏足够的指标

All of this seems to be pointing rather emphatically toward the lack of adequate indicators in the Mach0 64 binary parser which should be designed to tell us exactly what it needs which it is not seeing.

附录10 / 07/2012:

ADDENDUM ADDED 10/07/2012:

我添加了这个清单,希望澄清一个方式,无疑许多其他人谁会问这个问题在未来几年。这种方式反映了我在使用运行Snow Leopard的Mac上使用Eclipse Juno时所需要的:

I am adding this checklist in the hope of clarifying a Way for the undoubtedly many others who will ask this question in the years to come. This Way reflects what I found to be necessary when using Eclipse Juno with a Mac running Snow Leopard:

1)转到首选项 - > C / C ++ - >新建CDT项目向导,并在首选工具链下,确保所有可执行项目类型都设置为MacOSX GCC。

1) Go to Preferences->C/C++->New CDT Project Wizard, and under Preferred Toolchains, make sure all the Executable project types are set to MacOSX GCC.

2)这是一个biggie。我能够在Project Explorer中获取一个Binaries文件夹,因此可以通过使用不包含点['。']的项目名称来构建项目后运行该项目。这我从另一个答案学到了,在我以前的消息后几个小时编辑。这个需求很容易错过,因此常见的一个特别是如果你是Eclipse经验,但只有与其他语言,因为其他语言插件[如PyDev或Java]的教程经常有您创建项目与名称中的点。如果你已经开发了其他语言的习惯,当使用CDT for C / C ++时,打破它。但是,要预先警告,仅仅执行右键单击并重命名现有项目名称,这次不使用点是不够的。最简单的方法是删除您的旧项目,并创建一个新的名称没有点。

2) This is a biggie. I was able to get a Binaries folder in Project Explorer, and hence be able to run the project after building it, by using a Project name which does not contain dots ['.']. This I learned from another answer here, edited a few hours after my previous message. This requirement is easy to miss, hence a common one particularly if you are Eclipse experienced but only with other languages, because tutorials for other language plugins [such as with PyDev or for Java] frequently have you create Projects with dots in the name. If you have developed that habit with other languages, break it when using CDT for C/C++. Be forewarned, however, that it is not enough to just do a Right-Click and Rename an existing project name this time not using dots. The simplest Way is to delete your old project and create a new one with a name without dots.

3)有很多网站提醒您,以确保您使用-arch i386编译器开关或更改/ usr / bin / gcc和/ usr / bin / g ++的链接指向gcc-4.0和g ++ - 4.0而不是gcc-4.2和g ++ - 4.2。我创建了一个bash脚本,以方便来回切换,并调查是否这是必要的。这不是,至少不是与我的Macbook。基于我在一个站点从Mach-O开发人员读取的,我怀疑当前版本的Mach-0 64有两种方式。这是一个很好的segue ...

3) There are many websites cautioning you to make sure you either use the -arch i386 compiler switch or change the links for /usr/bin/gcc and /usr/bin/g++ to point to gcc-4.0 and g++-4.0 instead of gcc-4.2 and g++-4.2. I created a bash script to ease switching back and forth and investigated if this was necessary. It was not, at least not with my Macbook. Based on what I read at one site from a Mach-O developer, I suspect that the current version of Mach-0 64 goes both ways. Which is a good segue to ...

4)在项目属性,而不是首选项,去C / C + + Build->设置和二进制解析器确保马赫-O 64已选中解析器。确保这一点,而不是过时的Mach-O解析器。

4) In the Project Properties, not Preferences, go to C/C++ Build->Settings and under Binary Parsers make sure Mach-O 64 Parser is checked. Make sure this, and not the deprecated Mach-O parser, is checked.

5)此时,在构建项目之后,项目资源管理器:

5) At this point, after you build your project, several things should be evident in the Project Explorer:

6)现在应该在项目文件夹下有一个Binaries文件夹。

6) There should now be a Binaries folder under project's folder.

二进制文件夹现在应该是您的可执行文件。它应该有[x86_64 / le]旁边,如果,像我一样,你的Mac有效地32位。现在不是进入令人困惑的话题是你的Mac是有效的32位或64位的最好的时间。如果你不知道,很多人不,因为苹果确实令人困惑,检查出的小应用程序,可以从http://www.ahatfullofsky.comuv.com/English/Programs/SMS/SMS.html ,它会告诉您什么是真相。它是免费的,但价格是,你必须滚动页面顶部的广告反映程序员的政治态度。

7) Within that Binaries folder should now be your executable file. It should have [x86_64/le] next to it if, like me, your Mac is effectively 32bit. Now is not the best time to get into the confusing topic of whether your Mac is effectively 32bit or 64bit. If you do not know, and a lot folks don't because Apple does make it confusing, check out the little app which can be downloaded from http://www.ahatfullofsky.comuv.com/English/Programs/SMS/SMS.html which will tell you What Is Truth. It is free, but the 'price' is that you have to scroll pass the ads at the top of the page reflecting the programmer's political disposition.

这篇关于OS X Eclipse C ++启动失败 - 找不到二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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