Eclipse C++: Can't find a source file at.......

 

问题:当我windows上使用Eclipse调式C++程序的时候,报的错误大致如下,找不到某个源文件。

Can't find a source file at "/usr/src/debug/mingw64-i686-winpthreads-5.0.4-1/src/thread.c" 
Locate the file or edit the source lookup path to include its location.

Eclipse C++: Can't find a source file at.......

解决方案:Debug Configurations(右击可执行文件,Debug as,, 即可找到), Debugger Configurations在对应的Source的tag下。配置对应的源码寻找路线。比如选择Path Mapping路径映射。那么会将项目的/src路径映射到绝对路径D:\src,去寻找对应的源文件。

Eclipse C++: Can't find a source file at.......

 

可以参考:https://www.youtube.com/watch?v=KCq2yWDJNLM

总结:找不到什么文件,就直接使用路径映射,手动映射对应的搜索路径。