“启动失败。未找到二进制“ OS X 10.9.2中的Eclipse 4.3.0中的C错误 [英] "Launch failed. Binary not found" error for C in Eclipse 4.3.0 on OS X 10.9.2

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

问题描述

从今天初以来,我无法在Eclipse中编译任何C程序,因为在构建项目时不会创建必要的二进制文件,实际上它不会创建二进制文件夹。我已经试过我在这里看到的一切,试图解决它,只是变得更糟。以下是我迄今为止尝试过的结果:



启动失败。二进制未找到。雪豹和Eclipse C / C ++ IDE问题,终端:

  cd / usr / bin 
sudo rm cc gcc c ++ g ++
sudo ln -s gcc-4.0 cc
sudo ln -s gcc-4.0 gcc
sudo ln -s c ++ - 4.0 c ++
sudo ln -s g ++ - 4.0 g ++

这应该是从64位更改32位GCC 4.0的路径4.2。在这样做之后,我遇到了一个重大问题:我不再有任何类型的GCC,因为当我打电话给

 <$ c $在终端中,c> gcc -v 

返回:

  -bash:gcc:command not found 

为了使事情变得正确,我从Xcode重新下载了命令行工具并重新安装,Xcode确认安装它们。尽管如此,调用gcc -v仍然返回-bash:gcc:command not found。重复这个过程后,我得到了相同的结果,这样看起来好像我无法安装/找到所有的c编译器!这样做似乎也是以前的C项目的二进制文件在执行完毕后就消失了。



我也尝试过:


  1. 转到项目>属性> C / C ++ Build>设置>二进制解析器:确保选择了Mach-O 64解析器。


  2. 在MacOS XC Linker和GCC C编译器的其他部分中编辑标记文本框以保存-arch i686


没有一个这样工作...



我现在很失落,真的卡住了。如果有人可以帮忙,那将是非常感激的。



谢谢!

解决方案>

第一件事是第一件事:你有没有阅读/尝试过关于Ctrl键点击以选择Build Project的链接问题的最有帮助的答案?



我可以我不太会使用Eclipse来解决你的问题,但是我怀疑你现在可能已经搞砸了你的OS X安装。不幸的是,您使用的建议可能对SnowLeopard的时间表有帮助,但很有可能没有。当这种情况发生时,我不确定 ,但是GCC 4.0不再与OS X或Xcode一起运行,并且在10.9.2之间确实已经没了。它不会被Xcode或安装命令行工具选项所安装,所以如果你真的需要编译器的特定版本,你将不得不自己构建和安装。 p>

默认情况下,在最近的OS X安装中, / usr / bin 中的编译器可执行文件是有效调用 xcrun 来确定Xcode当前版本的位置。默认情况下 / usr / bin / gcc 指向您当前安装的Xcode版本的任何版本的 clang



我不知道如何在删除它们之后重新获取这些存根,但是我将从最新的Xcode安装开始,然后执行安装命令行工具再次,看看是否让你回到至少这些存根到位。



除此之外,我会寻找另一个接近你的问题与Eclipse。 Clang当然能够生成32位二进制文​​件。我不能想到一个很好的理由,你会想要使用GCC 4.0超过蛤蜊。


Since early today I have not been able to compile any C programs in Eclipse as it will not create the necessary binaries when I build a project, in fact it won't create a binaries folder at all. I have tried everything I've seen on here to try to fix it, and it's only gotten worse. Here's what I've tried so far and the results:

From "Launch Failed. Binary Not Found." Snow Leopard and Eclipse C/C++ IDE issue, in Terminal:

cd /usr/bin
sudo rm cc gcc c++ g++
sudo ln -s gcc-4.0 cc
sudo ln -s gcc-4.0 gcc
sudo ln -s c++-4.0 c++
sudo ln -s g++-4.0 g++

This was supposed to change the path to 32-bit GCC 4.0 from 64-bit 4.2. After doing this however, I had a major problem: I no longer had any type of GCC as evidenced by the fact that when I called

gcc -v

in Terminal, it returned:

-bash: gcc: command not found

In an attempt to make things right, I re-downloaded the Command Line Tools from Xcode and reinstalled them, and Xcode acknowledges that they are indeed installed. Despite this, calling gcc -v still returned -bash: gcc: command not found. After repeating this process, I got the same result, which makes it seem as if I cannot install/find the c compiler at all! It also seems that the binaries for previous C projects that worked when everything was fine disappeared after doing this.

I also tried:

  1. Going to Project > Properties > C/C++ Build > Settings > Binary Parsers : and making sure Mach-O 64 Parser was selected.

  2. Editing in the Miscellaneous sections of MacOS X C Linker and GCC C Compiler the flags textbox to hold "-arch i686"

None of this worked...

I am now at a loss and really stuck. If anyone can help, it would be greatly appreciated.

Thank you!

解决方案

First thing's first: Have you read/tried the most-upvoted answer on the linked question about Ctrl-click to select "Build Project"?

I can't really speak to your issue with Eclipse, as I don't use it, but I suspect that you've probably mucked up your OS X installation at this point. Unfortunately, the advice you used may have been helpful in the SnowLeopard timeframe, but it's most likely not any more. I'm not sure exactly when this happened, but GCC 4.0 is no longer shipping with OS X or Xcode and it's certainly gone as of 10.9.2. It won't be installed any more by either Xcode, or by the "Install Command Line Tools" option, so if you really need that specific version of the compiler, you're going to have to build and install it yourself.

By default, on recent OS X installs, the compiler executables in /usr/bin are stubs that effectively call xcrun to determine the location of Xcode's current version. By default /usr/bin/gcc points to whatever version of clang came with your currently-installed version of Xcode.

I'm not sure how to get those stubs back after deleting them, but I would start by doing a fresh install of the latest Xcode and then doing Install Command Line Tools again after that, and see if that gets you back to at least having these stubs in place.

Beyond that, I would look for another approach to your problem with Eclipse. Clang is certainly capable of generating 32-bit binaries. I can't think of a good reason that you would want to use GCC 4.0 over clang at all.

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

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