i'm trying setup qt inside windows 8.1 using jetbrains clion ide not show after compiling simple test project. main.cpp file:
#include <qapplication> #include <qtwidgets/qpushbutton.h> int main(int argc, char **argv) { qapplication *app = new qapplication(argc, argv); qpushbutton *x = new qpushbutton("test"); x->show(); return app->exec(); } this cmakelists.txt file:
cmake_minimum_required(version 3.2) project(qttest) set(cmake_prefix_path "c:\\qt\\qt5.5.0\\5.5\\mingw492_32\\") set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11") set(cmake_automoc on) set(cmake_include_current_dir on) set(source_files main.cpp) add_executable(qttest win32 ${source_files}) find_package(qt5core required) find_package(qt5widgets required) find_package(qt5gui required) find_package(qt5multimedia required) qt5_use_modules(qttest core widgets gui multimedia) target_link_libraries(qttest qt5::widgets qt5::gui qt5::core qt5::multimedia) the output:
process finished exit code -1073741515 (0xc0000135) now want solve problem.
the explicit memory management unnecessary. should never need use explicit qt module prefixes - if do, build not configured correctly. finally, never use qclass.h includes, use qclass.
your code should read follows. when environment correctly configured, should build , run without errors.
#include <qapplication> #include <qpushbutton> int main(int argc, char **argv) { qapplication app(argc, argv); qpushbutton button("test"); button.show(); return app.exec(); }
Comments
Post a Comment