这是你的答案http://www.eclipse.org/forums/index.php/t/57027/
如果您在 Windows 下工作,您是否设置了所需的映射?
也许 Eclipse 找不到源,因为缺少到的映射
您的项目/工作区所在的 (cygwin-)drive。
当您启动 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 => 首选项... => C/C++ => 调试 => 通用源查找
路径
- 添加新的路径映射:单击 [添加] => 路径映射 => [确定]
- 选择新的映射 => [Edith] => 更改映射名称“项目”
来源" => [添加]
- 将“编译路径”设置为源(示例 cygwin!)“/cygdrive/j”
(不带引号!)
- 设置“本地文件系统路径”和“J:\”(不带引号!)
现在你准备好再试一次......祝你好运!