当前位置:   article > 正文

vscode 开发qt6 开发环境搭建_vscode qt6

vscode qt6

vscode代码编辑器有自己一些优势,考虑用它开发qt6项目:

整个配置过程如下:

插件安装:

.mingw&cmake安装配置:

qt creator 创建一个测试工程,当然,工程是cmake类型 :

vsocode 打开cmakeLists.txt文件,回自动构建项目。

按crtl+shift+p 输入cmake,点击Select a Kit

选择编译器: 

 构建:

结果 :到输出文件夹下运行exe文件:

我遇到的问题,过往我装过多个环境等,但打开cmake,选择不到我的kit,还是原来的东西,曾想直接覆盖目录内容,但编译都无法启动了。

解决办法如下:

先删除如下文件:

原文件内容为:

  1. [
  2. {
  3. "name": "GCC 8.1.0 x86_64-w64-mingw32",
  4. "compilers": {
  5. "C": "D:\\tools\\mingw64\\bin\\gcc.exe",
  6. "CXX": "D:\\tools\\mingw64\\bin\\g++.exe"
  7. },
  8. "isTrusted": true,
  9. "environmentVariables": {
  10. "CMT_MINGW_PATH": "D:\\tools\\mingw64\\bin"
  11. },
  12. "preferredGenerator": {
  13. "name": "MinGW Makefiles"
  14. }
  15. },
  16. {
  17. "name": "Visual Studio Community 2022 Release - amd64",
  18. "visualStudio": "ed7b1979",
  19. "visualStudioArchitecture": "x64",
  20. "isTrusted": true,
  21. "preferredGenerator": {
  22. "name": "Visual Studio 17 2022",
  23. "platform": "x64",
  24. "toolset": "host=x64"
  25. }
  26. },
  27. {
  28. "name": "Visual Studio Community 2022 Release - amd64_x86",
  29. "visualStudio": "ed7b1979",
  30. "visualStudioArchitecture": "x64",
  31. "isTrusted": true,
  32. "preferredGenerator": {
  33. "name": "Visual Studio 17 2022",
  34. "platform": "win32",
  35. "toolset": "host=x64"
  36. }
  37. },
  38. {
  39. "name": "Visual Studio Community 2022 Release - x86",
  40. "visualStudio": "ed7b1979",
  41. "visualStudioArchitecture": "x86",
  42. "isTrusted": true,
  43. "preferredGenerator": {
  44. "name": "Visual Studio 17 2022",
  45. "platform": "win32",
  46. "toolset": "host=x86"
  47. }
  48. },
  49. {
  50. "name": "Visual Studio Community 2022 Release - x86_amd64",
  51. "visualStudio": "ed7b1979",
  52. "visualStudioArchitecture": "x86",
  53. "isTrusted": true,
  54. "preferredGenerator": {
  55. "name": "Visual Studio 17 2022",
  56. "platform": "x64",
  57. "toolset": "host=x86"
  58. }
  59. },
  60. {
  61. "name": "Visual Studio 生成工具 2022 Release - amd64",
  62. "visualStudio": "0aeaf3ef",
  63. "visualStudioArchitecture": "x64",
  64. "isTrusted": true,
  65. "preferredGenerator": {
  66. "name": "Visual Studio 17 2022",
  67. "platform": "x64",
  68. "toolset": "host=x64"
  69. }
  70. },
  71. {
  72. "name": "Visual Studio 生成工具 2022 Release - amd64_x86",
  73. "visualStudio": "0aeaf3ef",
  74. "visualStudioArchitecture": "x64",
  75. "isTrusted": true,
  76. "preferredGenerator": {
  77. "name": "Visual Studio 17 2022",
  78. "platform": "win32",
  79. "toolset": "host=x64"
  80. }
  81. },
  82. {
  83. "name": "Visual Studio 生成工具 2022 Release - x86",
  84. "visualStudio": "0aeaf3ef",
  85. "visualStudioArchitecture": "x86",
  86. "isTrusted": true,
  87. "preferredGenerator": {
  88. "name": "Visual Studio 17 2022",
  89. "platform": "win32",
  90. "toolset": "host=x86"
  91. }
  92. },
  93. {
  94. "name": "Visual Studio 生成工具 2022 Release - x86_amd64",
  95. "visualStudio": "0aeaf3ef",
  96. "visualStudioArchitecture": "x86",
  97. "isTrusted": true,
  98. "preferredGenerator": {
  99. "name": "Visual Studio 17 2022",
  100. "platform": "x64",
  101. "toolset": "host=x86"
  102. }
  103. }
  104. ]

再重新打开vscode,出现了我环境变量中配置的项目:

yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs=wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/783253
推荐阅读
相关标签
  

闽ICP备14008679号