关于eclipse 中Type 'xxxx' could not be resolved 或者 symbol 'xxxx' could not be resolved 的解决办法

要解决Type 'xxxx' could not be resolved 或者 symbol 'xxxx' could not be resolved  的问题

首先确保 头文件是否添加

======》定义结构体和宏 的对应 头文件有没有include 进来,这个是最基本的,如果工程比较大,可以使用Source Insight 把工程导到那里去, 看看文件的关联性。即哪些头文件定义了哪些变量 哪些宏 哪些结构体


然后确保对应的路径 有没有添加到 路径中

====》如下图 所示,对应 的库 路径 添加进来, 当然也可以 在c 代码文件中, include 时将文件的绝对路径全写出来

不过那样就有点傻傻的感觉

关于eclipse 中Type 'xxxx' could not be resolved 或者 symbol 'xxxx' could not be resolved 的解决办法

最后一切都正常后,确保索引有没有重新建立

===》 有时觉得很奇怪,为什么我对应的路径 和头文件都添加对了,但是还是显示could not be resolved  的错误,

因为eclipse 是一个 editor 它并不是和source insight 那样智能的可以 时时更新索引, 所以添加好之后 可以按照下面步骤更新一下索引!

关于eclipse 中Type 'xxxx' could not be resolved 或者 symbol 'xxxx' could not be resolved 的解决办法