安装相关Cmake插件,C++插件;
新建文件 c_cpp_properties.json 并配置如下信息,放到项目根目录下的.vscode文件夹中:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/Qt/qt5.15.2/5.15.2/msvc2019/include",
"C:/Qt/qt5.15.2/5.15.2/msvc2019/include/QtWidgets",
"C:/Qt/qt5.15.2/5.15.2/msvc2019/include/QtGui",
"C:/Qt/qt5.15.2/5.15.2/msvc2019/include/QtCore",
"C:/Qt/qt5.15.2/5.15.2/msvc2019/include/QtSerialPort",
// 其他 Qt 模块的包含路径...
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/Qt/qt5.15.2/Tools/mingw810_32/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}