microsoft / microsoft/vscode-cpptools

Qt header files not recognized

Aperta
#11,769 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

Nessuno ha ancora preso questa issue.

investigate: repro
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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

IDE error

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

lsp-logs.txt

Configuration and Logs
Logs attached in file `lsp-logs.txt`
Other Extensions

No response

Additional context

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.