M
M
Moolzv Rivers2019-07-05 07:44:25
Qt
Moolzv Rivers, 2019-07-05 07:44:25

How to run programs with Qt\C++ interface?

Okay, maybe a stupid question, but I didn't find the answer.
So: let's say I created a program in Qt, it has files:

main.cpp mainwindow.h mainwindow.ui Notebook.pro.user
mainwindow.cpp mainwindow.h.gch Notebook.pro

How do I run it? When I compile files with g++ I just get an error:

mainwindow.h:4:10: fatal error: QMainWindow: No such file or directory
#include QMainWindow

How do I run it with the interface on other PCs?
Added: let's imagine that I sent this program to a friend, he does not have qtcreator, but he wants to run a program with an interface on his PC, what should he do?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
Jacob E, 2019-07-05
@SaddledSharp

Added: let's imagine that I sent this program to a friend, he does not have qtcreator, but he wants to run a program with an interface on his PC, what should he do?
It needs to be compiled and delivered along with all libraries: https://evileg.com/en/post/163/

D
devalone, 2019-07-05
@devalone

Use builders like qmake or cmake.

A
Adamos, 2019-07-05
@Adamos

Notebook.pro is a QtCreator project. Download, install, open, explore.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question