Preprocessor Include Paths, Macros etc. entry not available

一世执手 提交于 2019-12-11 15:03:46

问题


I can't navigate through a project in Eclipse (Oxygen.3a Release (4.7.3a) with CDT version 9.4.3.201802261533). The project is built successfully but I can't trace back many functions using ctrl+LMclick.

I tried fixing the problem from online resources, but many suggested modifying the entry of Preprocessor Include Paths, Macros etc, which my project does not even have. What is the reason behind this and how do I fix it?

For some reason, the next entry (C/C++ Include Paths and Symbols) shows that |Include path not found"

When I try to trace a function, I get the "Could not find symbol "xyz" in index". I have already tried rebuilding the indexer but it did not work for me.


回答1:


In my experience, the absence of the Preprocessor Include Paths, Macros etc. preference page happens in newer versions of CDT when you select the new Makefile Project option in the new project wizard, whose description is

(Experimental) Create a new project that builds with the 'make' build tool using CDT's new Core Build System.

I would avoid using this as it's experimental, and would select instead C Managed Build (or C++ Managed Build). On the next wizard page you can still make it a makefile project if you want.




回答2:


I ran into this problem trying to use cmake4eclipse. I forgot to heed the warning in the help file, which explicitly state: "Do not choose the New C/C++ project wizard, as that will take you down the road of CDT`s new project type (which has poor cmake support)."

What this means is that, for the entry to appear in an executable / library -type project (not Makefile project), you have to do this now:

  1. File --> New --> Other...
  2. Choose "C++ Project" (not "C/C++ Project") under the C/C++ category:

P.S. Also, I had to remake the folder and copy all the sources there, i.e. when I tried the old wizard on top of a "deleted" project, something didn't override correctly and I was still missing "Preprocessor Include Paths, ...". Deleting .cproject and .project files within the folder before recreating works too.




回答3:


Depending on your project, you may need to include the path of the toolchain manually. It wasn't for me. So for my project I did the following:

Go to Project – Properties – C/C++ Include Paths and add there “C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\arm-none-eabi\include” (change to fit your installation). Then refresh, clean and build the project. Finally, rebuild the indexer and this should work.



来源:https://stackoverflow.com/questions/50792865/preprocessor-include-paths-macros-etc-entry-not-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!