問題:用eclipse 建立編譯C++工程出現錯誤提示 symbol could not be resolved
解決辦法:
1.window -> preferences -> C/C++ -> debug -> source lookup path > Path Mapping
Name:whatever CompilationPath: \cygdirve\c Local file system path:C:\
用cygwin下的c盤來替代當前的C盤 來查找需要的庫文件
2.indexer: index source and header files opened in editor
window -> preferences -> C/C++ -> indexer
OK編譯的錯誤解決了
運行時又出現了如下的BUG:

找不到對應的文件,無法進行調試,GOOGLE了半天才找到解決的方法:
If you're working under Windows, have you set the required mappings?
Maybe Eclipse couldn't find the Source because of the missing mapping to
the (cygwin-)drive where your projects/workspaces are.
When you start Cygwin, enter "mount" and look for the mapping you have:
They may look like this:
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)
My Projects ara all under J:\Projects, so my mapping needs to be present
in Eclipse as:
/cygdrive/j j:/
Open Eclipse and then click
- Windows => Preferences
=> C/C++ => Debug =>Common Source Lookup
Path
- Add a new Path Mapping: click [Add] => Path Mapping => [OK]
- Select the new Mapping => [Edith] => change Name of Mapping "Project
Source" => [Add]
- set "Compilation path" to the Source (Sample cygwin!) "/cygdrive/j"
(without the quotes!)
- set"Local file system path" tho "J:\" (without the quotes!)
上面配置對應了/cygdrive/c C:\Maybe Eclipse couldn't find the Source because of the missing mapping to
the (cygwin-)drive where your projects/workspaces are.
When you start Cygwin, enter "mount" and look for the mapping you have:
They may look like this:
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)
My Projects ara all under J:\Projects, so my mapping needs to be present
in Eclipse as:
/cygdrive/j j:/
Open Eclipse and then click
- Windows => Preferences
=> C/C++ => Debug =>Common Source LookupPath
- Add a new Path Mapping: click [Add] => Path Mapping => [OK]
- Select the new Mapping => [Edith] => change Name of Mapping "Project
Source" => [Add]
- set "Compilation path" to the Source (Sample cygwin!) "/cygdrive/j"
(without the quotes!)
- set"Local file system path" tho "J:\" (without the quotes!)
但是我在windows下的工程目錄都是在G盤,同樣添加一個G盤的對應目錄就OK了


