microsoft / microsoft/vscode-cpptools
Qt header files not recognized
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and Version: macOS 14.1.2
- VS Code Version: 1.85.0
- C/C++ Extension Version: v1.18.5
Bug Summary and Steps to Reproduce
Hello,
I have a minimal Qt sample project based on CMake. Qt is installed locally and in my local settings.json I refer to my local Qt installation path:
{
"cmake.configureArgs": [
"-DCMAKE_PREFIX_PATH=/Users/stefano/Qt/6.5.1/macos/lib/cmake/"
]
}
In CMakeLists.txt I search also for the packages:
find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(${target} Qt::Core)
It builds successfully (!), but when I open TestClass.h, I get following error message:
'QtCore/qobjectdefs.h' file not found
Strangely, I can click with CMD + click into the header file, never the less, VS Code gives me the said error message!
CLion in the other hand does not have this problem.
I have attached my minimal project. I hope, you can help me.
Thanks in advance!
QtSampleProjectFromScratch.zip
Configuration and Logs
Logs attached in file `lsp-logs.txt`
Other Extensions
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.