Skip to content

External dependency not found, but found #10216

@cdecompilador

Description

@cdecompilador

Environment

  • OS and Version: Windows 10
  • VS Code Version: 1.73.1
  • C/C++ Extension Version: 1.13.5 (also happend on stable)

Bug Summary and Steps to Reproduce

Bug Summary: It marks external dependency headers at not found, but still you can jump to them and on the logs seems like the compile commands include them, but with wrong case
Let's do a simple example with external dependency, with cmake and using git submodules:
CMakeLists.txt

cmake_minimum_required(VERSION 3.0.0)
project(MyProject VERSION 0.1.0)

add_subdirectory("third_party/fmt")

add_executable(MyProject Main.cpp)
target_link_libraries(MyProject
    fmt)

Remember to clone the fmt library on third_party folder
main.cpp

#include <fmt/core.h>

int 
main(int argc, char** argv) 
{
    fmt::print("Hello World");
    return 0;
}

If you compile this with cmake:

cmake -B build
cmake --build build

It works just fine, but cpptools is having trouble resolving <fmt/core.h>
image

Here are the logs:

-------- Diagnostics - 1/12/2022, 17:54:34
Version: 1.13.5
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.22000.0",
    "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "windows-msvc-x64",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": [
        "c:/users/nnyag/documents/vs-test/deps/fmt/include",
        "c:/users/nnyag/documents/vs-test",
        "c:/users/nnyag/documents/vs-test/deps/fmt/src",
        "c:/users/nnyag/documents/vs-test/deps/fmt/include/fmt",
        "c:/users/nnyag/documents/vs-test/deps/fmt"
    ],
    "compilerPath": "c:/strawberry/c/bin/g++.exe",
    "compilerArgs": [],
    "compilerFragments": [
        "-g"
    ]
}
Custom configurations:
[ C:\Users\nnyag\Documents\vs-test\Main.cpp ]
{
    "includePath": [
        "c:/users/nnyag/documents/vs-test/deps/fmt/include"
    ],
    "defines": [],
    "compilerPath": "c:/strawberry/c/bin/g++.exe",
    "compilerArgs": [],
    "compilerFragments": [
        "-g"
    ]
}

There is a clear mistake here

The include paths contains the path with all the letters lowercase:
image

This error also occurs with clangd so it might be related to the editor itself, also can't be the cmake tools extension, since I've tried generating the compile_commands.json manually (also the compile commands contains the proper path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: ConfigurationAn issue related to configuring the extension or IntelliSenseLanguage Servicebugmore info neededThe issue report is not actionable in its current statenot reproingWe're not able to reproduce the issue (it's unlikely to get fixed until we find one).

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions