Mac C++/eclipse cannot debug: Error while launching command: gdb --version(Mac C++/eclipse 无法调试:启动命令时出错:gdb --version)
问题描述
我在 mac 上使用 c++/eclipse kepler,我无法调试任何项目.错误是启动命令时出错:gdb --version"除此之外,我可以使用其他库构建和运行我的代码.
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.
我搜索了一个与我的问题类似的网站:Debugger for C++ eclipse 给出以下错误.'Launching program name' 遇到了...启动命令时出错:gdb --version
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
但是如果我使用的是 mac,我应该改变什么?
But what should I change if I am using a mac?
推荐答案
您可以通过指定 gdb 的完整路径来解决此问题.您可以为每个调试配置单独执行此操作,也可以在 C/C++ > GDB 下的首选项中设置默认 gdb 位置.例如,如果您通过 Homebrew 安装 gdb,那么它可能位于 /usr/local/bin 下:
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:
我仍然不知道为什么 Eclipse 无法找到 GDB,即使它在我的路径上.我猜它不使用我的 .bash_profile 或我的 .bashrc?您可以尝试将 gdb 符号链接到 /usr/bin.也许 Eclipse 会看那里.
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.
我尝试了符号链接的想法,现在 Eclipse 可以调试了,但是这样做时它会莫名其妙地崩溃!所以,我猜...不要那样做?
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Mac C++/eclipse 无法调试:启动命令时出错:gdb --version
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
