heliopetuous

vscode 解析 include 本地头文件和同名库文件的问题求解

  •  
  •   heliopetuous · Jul 31, 2020 · 3428 views
    This topic created in 2112 days ago, the information mentioned may be changed or developed.
    问题是这样的:
    本地 project 里有一个 assert.h,但 F12 看这个 include “assert.h”显示的 /usr/include 下的 assert.h ;
    因为本地 assert.h 里有一些自己定义的东西,vscode 总是识别不了。
    请问有人了解这个问题应该怎样解决吗?
    3 replies    2021-05-07 09:58:17 +08:00
    dalabenba
        1
    dalabenba  
       Jul 31, 2020 via Android
    好像有 exclude 的选项吧
    heliopetuous
        2
    heliopetuous  
    OP
       Jul 31, 2020
    @dalabenba 试过 files.exclude,没有效果,感觉它里面这些 exclude 都是对搜索时的结果做 filter
    Ysxcc
        3
    Ysxcc  
       May 7, 2021
    c_cpp_properties.json 中设置 include 的位置,不要使用**递归搜索。或者使用 forcedInclude 直接加入你的头文件,不过这样还是会跳转到库文件,但是这样也能解决这个问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5645 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 08:23 · PVG 16:23 · LAX 01:23 · JFK 04:23
    ♥ Do have faith in what you're doing.