Mac C ++ / eclipse无法调试:启动命令时出错:gdb --version [英] Mac C++/eclipse cannot debug: Error while launching command: gdb --version

查看:1033
本文介绍了Mac C ++ / eclipse无法调试:启动命令时出错:gdb --version的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上使用c ++ / eclipse开普勒,我无法调试任何项目。错误是启动命令时出错:gdb --version除此之外,我可以使用其他库构建和运行我的代码。



我搜索了一个类似的站点对我的问题: C ++ eclipse的调试器给出以下错误。 启动程序名称遇到...启动命令时出错:gdb --version



但是,如果我正在使用mac ?

解决方案

您可以通过指定gdb的完整路径来解决此问题。您可以分别为每个调试配置执行此操作,还可以在首选项中设置默认的gdb位置,方法是使用 C / C ++> GDB 。例如,如果您通过Homebrew安装gdb,那么它可能位于 / usr / local / bin 之下:





这是一个截图偏好:





我仍然不知道为什么Eclipse无法找到GDB,即使它在我的路径上。我想它不使用我的 .bash_profile 或我的 .bashrc ?您可以尝试使用符号链接gdb到 / usr / bin 。可能Eclipse会看到那里。



编辑:我尝试了符号链接的想法,现在Eclipse可以调试,但是在这样做时,它会令人难以置信的崩溃!所以,我想... 不要这样做?


I am using c++/eclipse kepler on mac, and I cannot debug any project. The error is "Error while launching command: gdb --version" Besides that, I can build and run my code using other libraries.

I searched a site that is similar to my problem: Debugger for C++ eclipse gives the following error. 'Launching program name' has encountered a ... Error while launching command: gdb --version

But what should I change if I am using a mac?

解决方案

You can fix this by specifying the full path to gdb. You can do this separately for each debug configuration, and you can also set the default gdb location in the preferences under C/C++ > GDB. For example, if you installed gdb via Homebrew, then it's probably located under /usr/local/bin:

And here's a screenshot of the Preferences:

I still don't know why Eclipse can't find GDB even though it is on my path. I guess it doesn't use my .bash_profile or my .bashrc? You could try symlinking gdb into /usr/bin. Maybe Eclipse will look there.

Edit: I tried the symbolic link idea and now Eclipse can debug, but it crashes inexplicably while doing so! So, I guess... don't do that?

这篇关于Mac C ++ / eclipse无法调试:启动命令时出错:gdb --version的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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