【问题标题】:How to find the include route to a specific header in eclipse?如何在 Eclipse 中找到指向特定标头的包含路由?
【发布时间】:2017-12-16 18:33:27
【问题描述】:

我有一个 cpp 文件,a.cp​​p,其中包括

a.cpp
  b.hpp
    c.hpp
    d.hpp
      e.hpp
  f.hpp

如果我有兴趣查找包含 e.hpp 的位置,我想获取它的路径,即 b.hpp->d.hpp->e.hpp

我可以看到包含浏览器视图中包含的所有树,但此视图不允许我搜索结果,并且对于很多包含,这很快就会变得难以管理

【问题讨论】:

    标签: c++ eclipse header include


    【解决方案1】:

    你可以用 gcc 做类似的事情:

    g++ -H source.cpp

    来自 gcc 文档:

    -H
     Print the name of each header file used, in addition to other normal activities. Each name is indented to show how deep in the  #include stack it is. Precompiled header files are also printed, even if they are found to be  nvalid; an invalid precompiled header file is  printed with ...x and a valid one with ...!.
    

    输出将显示谁包括谁: ........ /usr/include/pthread.h ......... /usr/include/sched.h .......... /usr/include/time.h .......... /usr/include/bits/sched.h

    【讨论】:

    • 这可以部分解决问题,但我想知道 eclipse 中的解决方案:/ 无论如何谢谢!
    • 我不知道任何来自 Eclipse 的信息,抱歉!
    猜你喜欢
    • 1970-01-01
    • 2016-03-30
    • 2023-03-29
    • 1970-01-01
    • 2018-06-10
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 2011-01-09
    相关资源
    最近更新 更多