Eclipse 错误:“没有可用的源”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5219081/
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-09-10 20:00:37  来源:igfitidea点击:

Eclipse error: No source available for ""

eclipsedebuggingassembly

提问by Open the way

Using Eclipse Helios in Mac OS X Leopard and debugging C++ code calling fsf gdb 7.1, the debugging stops at first line of main. Then after the first step I get

在 Mac OS X Leopard 中使用 Eclipse Helios 并调试调用 fsf gdb 7.1 的 C++ 代码,调试在 main 的第一行停止。然后在第一步之后我得到

No source available for ""
View disassembly

Why this error? Should I give additional options for compilation? Eclipse generated automatically the Makefile

为什么会出现这个错误?我应该提供额外的编译选项吗?Eclipse 自动生成 Makefile

回答by FossilBit

I had the same problem and the following solved it:

我遇到了同样的问题,以下解决了它:

Go to menu Run->Debug Configurations...and a dialogue window opens. On the left there should be selected your project name (say MyProjectfor example) under C/C++ Application. If not select it. Then on the right side, select the tab mainand make sure that in the textbox under C/C++ Applicationreads: Debug/MyProject. Also check that Debugis selected in the dropdown box next to Build Configuration:below.

转到菜单Run->Debug Configurations...并打开一个对话窗口。左边有应选择您的项目名称(比如MyProject的下为例)C/C++ Application。如果没有选择它。然后在右侧,选择选项卡main并确保在文本框中C/C++ Application读取:Debug/MyProject。还要检查是否在下面的下拉框中选择了调试Build Configuration:

In my case instead of Debug/MyProject, it was Release/MyProject. I never understood why. Anyway...

在我的例子中,它不是Debug/MyProject,而是Release/MyProject。我一直不明白为什么。反正...

Hope that helps

希望有帮助