-
Notifications
You must be signed in to change notification settings - Fork 453
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
In the case of compilation, intellisense always indicates that the header file cannot be found #3824
Comments
Are you trying to compile with cl.exe? Did you run CMake: Configure? When you run C/C++: Log Diagnostics with a C++ file active what is the output in regards to system includes? |
Here is my configuration result, but it didn't work [proc] Run the command D:\QT6\Tools\CMake_64\bin\cmake.exe --version |
@shawn1j Yeah, can you check the C/C++: Log Diagnostics output with a C/C++ file active? Or if you set C_Cpp.loggingLevel to "Debug" and check the "C/C++" logging for message "Custom configurations received:" that will show what receive from the CMake Tools extension after opening a file. |
This is my c/c + + log output (because there is too much content, I stored it in the file): |
@shawn1j Your logging indicates CMake Tools is not sending us any configuration info for the header files that are opened, i.e. it doesn't appear that you're configured correctl or it could be a CMake Tools issue. |
@shawn1j Thank you for reporting this issue. Regarding this issue, we tried to reproduce this issue using a simple demo project however we were unable to reproduce this issue for you. In order to investigate further, please provide us with a simple demo project to reproduce the issue and we look forward to your feedback. |
Of course, here's my case, and it's very simple. CMakeLists.txt
main.cpp
The following is the output of cmake-tools, because c/ C ++ output too much information, I put it in the c_cpp.logging.txt file.
Environment
|
@shawn1j I'm very sorry, I don't get this error with the code you provided, can you give me some advice? |
@shawn1j When I start vscode without Visual Studio 2022 Developer Command Prompt I get a generator not found, which should be normal because my generator is installed by installing VS and not separately, but I still can't reproduce the problem you described. |
For now, closing since user has a workaround and we weren't able to reproduce. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
I am using vscode to build my project, I use cmake to build my project, which uses qt library and some other third party libraries, my project can compile normally and run successfully. But in my code file, there is always an error ripple on this side of the #include header. This is a problem even with iostream headers. I tried to add a header search path for qt and other third-party libraries to the includePath field in the c_cpp_properties.json file, or "configurationProvider": "ms-vscode.cmake-tools", adds a path to the C_Cpp.default.includePath field in the settings.json file, but these attempts do not work, and the problem persists.
Below is the directory structure of my project:
C:\USERS\SJ2003\DESKTOP\VIDEOCALL
│ CMakeLists.txt
│ dialog.cpp
│ dialog.h
│ Dialog.ui
│
├─.vscode
│ c_cpp_properties.json
│
└─build
│ ALL_BUILD.vcxproj
│ ALL_BUILD.vcxproj.filters
│ CMakeCache.txt
│ cmake_install.cmake
│ VideoCall.sln
│ VideoCall.vcxproj
│ VideoCall.vcxproj.filters
│ ZERO_CHECK.vcxproj
│ ZERO_CHECK.vcxproj.filters
│
├─.cmake
│ └─api
│ └─v1
| .......
Configuration and Logs
Other Extensions
cmake v0.0.17
cmake-tools v1.18.41
cmake language support v0.0.9
Additional context
CMakeLists.txt
The text was updated successfully, but these errors were encountered: