CMake + vscode
-
Hi and welcome to devnet,
Might be a silly question but do you show any widget in your application ?
If so, can you share your main.cpp file ?
Does the application start successfully ?
-
My main.cpp
#include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPushButton button("Hello world!", nullptr); button.resize(200, 100); button.show(); return QApplication::exec(); }
Both CMakeLists build the project but the second one do nothing when i run the build.
-
That looks perfectly fine.
How do you start your application ?
-
And you have no error ? Just the application that is hanging ?
-
-
It's not hanging it just runs without error.
Why i have to copy all that and can't use the CMake of the tutorial ? -
If you take Qt Creator, it will adapt the PATH environment variable so that it will contain the path for the Qt version you are using to build your application. If your current IDE does not provide that automation, then your application will need to have all its dependencies copied beside it. That is nothing Qt specific though, any dependency you have must be findable by your executable,