0

enter image description here

I Just want to code Qt qmake project in vscode and UI in main qt editor, But Vs code not finding qt library, tried hard but not find any solution or good installation source.

[main.cpp 2022-12-05 15:28:59.408]
,,In file included from main.cpp:1:
mainwindow.h:4:10: fatal error: QMainWindow: No such file or directory
    4 | #include <QMainWindow>
      |          ^~~~~~~~~~~~~
compilation terminated.

Tried including path but didn't work.

bash: /usr/local/Qt-6.4.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/Qt:/opt/Qt/Tools/QtCreator/bin:/opt/Qt/Tools/QtDesignStudio/bin:/opt/Qt/Tools: No such file or directory

I watch some solution in stack overflow, but didn't work for me

O'Neil
  • 3,790
  • 4
  • 16
  • 30
  • The default VSCode configuration will not build a Qt application for multiple reasons. You probably want to use CMake and the CMakeTools extension for VSCode. – drescherjm Dec 05 '22 at 15:45
  • tried , if you have a good source how to configure it please give me the source – Tahmidul Kashfi Dec 05 '22 at 15:48
  • Installing CMakeTools is easy: [https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) – drescherjm Dec 05 '22 at 15:48
  • Creating a CMakeLists.txt for Qt is a little harder as you will have to spend a few days time learning CMake. There are many examples you can use as a basis: [https://stackoverflow.com/questions/25989448/implementing-qt-project-through-cmake](https://stackoverflow.com/questions/25989448/implementing-qt-project-through-cmake) – drescherjm Dec 05 '22 at 15:49

0 Answers0