这是你的答案:
http://www.eclipse.org/forums/index.php/t/57027/
如果你在Windows下工作,是否设置了必要的映射?可能由于缺少对项目/工作区所在(cygwin-)驱动器的映射,Eclipse找不到源。
当你启动Cygwin时,请输入“mount”并查找你拥有的映射:它们可能看起来像这样:
Admin@bs11-01xp ~
$ mount
D:\cygwin\bin on /usr/bin type system (binmode)
D:\cygwin\lib on /usr/lib type system (binmode)
D:\cygwin on / type system (binmode)
c: on /cygdrive/c type system (binmode,noumount)
d: on /cygdrive/d type system (binmode,noumount)
e: on /cygdrive/e type system (binmode,noumount)
j: on /cygdrive/j type system (binmode,noumount)
n: on /cygdrive/n type system (binmode,noumount)
u: on /cygdrive/u type system (binmode,noumount)
w: on /cygdrive/w type system (binmode,noumount)
x: on /cygdrive/x type system (binmode,noumount)
y: on /cygdrive/y type system (binmode,noumount)
z: on /cygdrive/z type system (binmode,noumount)
我的项目都在 J:\Projects
下,所以我的映射需要在 Eclipse 中呈现为:
/cygdrive/j j:/
打开Eclipse,然后点击
- Windows => Preferences... => C/C++ => Debug =>Common Source Lookup
Path
- 添加一个新的路径映射:点击[Add] => Path Mapping => [OK]
- 选择新的映射 => [Edith] => 更改映射名称为"Project Source" => [Add]
- 将"Compilation path"设置为源代码路径(示例cygwin!) "/cygdrive/j"(不包括引号!)
- 将"Local file system path"设置为"J:\" (不包括引号!)
现在您已经准备好再试一次了....祝你好运!