I have full working project for QtCreator and I try to run it in VSCode. There is configuration inside the project the c_cpp_properties.json with following include paths:
"includePath": [
"${workspaceFolder}/**",
"C:\Qt_v2\6.7.0\msvc2019_64\include\QtCore\**"
],
but this doesn’t lead to success, there are still many errors.
Typical errors inside project header files “qobject.h(10, 10): ‘QtCore/qobjectdefs.h’ file not found” or inside the deep library code “this declaration has no storage class or type specifierC/C++(77), QT_BEGIN_NAMESPACE” and a lot of other errors.”
Part of CMakeList.txt
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 6.5 REQUIRED COMPONENTS
Core
Charts
Sql
Quick
SerialBus
Scxml
Test
Xml
LinguistTools
Widgets
)
qt_standard_project_setup(REQUIRES 6.5)
# Link the Qt modules
target_link_libraries(app-name PRIVATE
Qt6::Quick
Qt6::Sql
Qt6::Xml
Qt6::Scxml
Qt6::Core
Qt6::Widgets
)
target_link_libraries(app-name LINK_PUBLIC
App
GUIplugin
)
It looks like I have included wrong path or something else. There is no good explanation on internet to read what to configure in VSCode to be able to code with Qt 6.7 in VSCode (I have installed QtCreator).
The final expectation are to have the code without errors inside Qt includes, to have auto complete and be able to build the code.