Eclipse c++ Type could not be resolved error even though build is successful

前端 未结 5 2169
囚心锁ツ
囚心锁ツ 2020-12-13 19:08

I have mixed C++ / Java project in Eclipse. I\'ve setup a build.mk file and Eclipse builds project successfully when all files in editor are closed. When I open a .h or a .c

5条回答
  •  暖寄归人
    2020-12-13 20:05

    I finally figured this out. Flushing the Eclipse Indexer as mentioned in the top voted answer didn't work for me. This is what I had to do:

    I went to: Project -> Properties -> C/C++ General -> Paths and Symbols -> Includes

    Here I had the path for my include directory, but what I had to do was delete the directory path, and then re-add it making sure to check the box "Add to all configurations". I also checked the box "Add to all languages", but I don't think that is necessary.

    After this, you may need to then click on Project -> C/C++ Index -> Rebuild. I didn't need to, but you might. Also, obviously instead of C/C++ in the paths above, it will be Java or whatever language you are dealing with.

提交回复
热议问题