-
Notifications
You must be signed in to change notification settings - Fork 432
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
Intellisense is not resolving MacOS frameworks in with CMake extension #3094
Comments
If it's helpful for debugging, I have found that I can add
to my root CMakeLists.txt, before including my It doesn't entirely squash the intellisense errors but it does reduce them. Maybe, since these aren't legitimate CMake or C++ errors, that there's a discrepancy between the includePaths that are being generated for intellisense and the actual included paths used for the build? |
Thanks for the report. I'm guessing this is a similar issue to #2324 where the JSON response files we get back from CMake (which are used to power IntelliSense) don't contain all the include paths used by the project. In particular, the response files won't contain paths that are injected by the generator itself. I'm not sure when we'll be able to get to this issue but I'm leaving it open for others to vote on and comment. |
I have reported a similar issue. Maybe in the cpptools repo. |
I don't know enough about how the Intellisense works or how the cmake and cpptools extensions communicate but I don't think it's generator-specific. I can change to "Unix Makefiles" and I get the same Intellisense errors. The fundamental Intellisense errors are that it can't resolve .h files like If anyone can point me in a direction, I'm happy to look deeper and try to find a fix. |
I think I may have found the problem and it was totally with my configuration. If anyone should run into similar issues, I was able to get all the intellisense working with the following settings inside c_cpp_properties.json
|
@lucianthorr because What we should probably do instead is add a workaround to cpptools to have it allow reading from the |
Thanks. Although, I want to mention in the specific case of the Accelerate framework, adding it or its dependency If it is possible for CMake Tools to honor the paths added to |
I didn't scroll horizontally earlier. The correct framework path is: I don't have a mac handy to test child framework includes right now, but I seem to recall writing code years ago to handle discovering child frameworks (veclib in this case). I'm not sure how you're including the framework headers in your code, but as per Apple documentation I would expect it to be like this:
as opposed to direct inclusion like this:
The path you shared above hints that you might be using the second example's syntax, so I just wanted to check. |
My code just has I have also tried adding the sub-framework to macFrameworkPath like My entire c_cpp_properties is
|
@lucianthorr since we're getting into issues with the actual language server now, I reposted your latest comment over in the cpptools Issues page. We should be able to better help you over there. |
Thanks again for all the help working through this. |
Brief Issue Summary
Hi. I have a C++ project that with multiple MacOS dependencies. The project all looked fine in VSCode using the
c_cpp_properties.json
settings where I could set the includePaths and MacFrameworkPaths.I have now added CMake to the project and it all works and builds using
but now the intellisense is not able to resolve any of the #include statements that are pulling in MacOS frameworks and libraries
CMake Tools Diagnostics
Debug Log
No response
Additional Information
The diagnostics was generated while looking at the SoundDevice.h file. If the
responses[0].configuration.includePath
is supposed to be all the included paths available for SoundDevice.h, then that would explain the issue.How can I get the
includePath
for SoundDevice.h to include all of the libraries that have been linked in CMakeLists.txt?The text was updated successfully, but these errors were encountered: