Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Library header files can't be found #16159

Closed
1 task done
Sickeroni opened this issue Apr 26, 2024 · 3 comments
Closed
1 task done

[question] Library header files can't be found #16159

Sickeroni opened this issue Apr 26, 2024 · 3 comments
Assignees

Comments

@Sickeroni
Copy link

Sickeroni commented Apr 26, 2024

What is your question?

disclaimer

In the First place a question, but maybe already a feature request. I'm not even sure if conan itself is the right place for this.

System details

  • WSL with ubuntu.22.04 under Windows 11
  • g++-12 (through apt)
  • cmake 3.29.2 (through snap)
  • Conan 2.0.16
  • VS Code with cmake plugin 1.88.1
  • Project uses the conan provider file

The Problem

It's so far mostly annoying and it slow downs developing.

For every library provided by conan, the header files can't be found in vscode so far.
But they can be found by the build process itself.
For external libraries like fmt it can be okayish, but we develop custom libraries and for debug purposes this is a big deal. Also even header of external libraries can provide helpful details about some functions, when used.

image

Also since i can't remember to ever had that problem, i think it worked prior than using conan.

Expected behaviour:

Click on a header in vscode and just press F12 to open the corresponding, conan provided file.

other sources

The only search result I could find was this similar one
microsoft/vscode-cmake-tools#1735
But based on the result it's already fixed in vscode 1.7.0

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Apr 26, 2024
@memsharded
Copy link
Member

Hi @Sickeroni

Thanks for your question.

I am not sure what Conan can do in this regard either.
Conan just generates xxx-config.cmake files and conan-toolchain.cmake that CMake correctly understands, so up to our knowledge they are correct in that regard.

I don't know how VSCode or the VSCode plugins (cmake-tools) are working to provide navigability to headers, but I would assume they would be taking the information from the build system, but apparently it doesn't if it is not working?

We would need better understanding on how VSCode works in this regard, and what could be missing.

@SpaceIm
Copy link
Contributor

SpaceIm commented Apr 26, 2024

I use VSCode for C++, and it depends on the plugin used for C++ completion/intellisense etc. Most populars are "C/C++" and "clangd" I would say (and looking at your error, I guess it's "C/C++").

When you use CMake, these plugins expect to see compile_commands.json generated by CMake configuration in some predefined or customizable location.

So for me it's an issue related to your VSCode settings, not to conan.

@Sickeroni
Copy link
Author

This makes completly sense.
therefore close and big thanks for the fast answers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants