How do I run a program in QT creator?
-
Installed the QT creator program Now, first of all, I'm just trying to run the first code through QML: main.qml:
import QtQuick 2.12 import QtQuick.Window 2.12 Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") Tile { width: root.width / 4 height: root.height / 4 } }
Tile.qml:
import QtQuick 2.0 Rectangle { id: root color: "lightgreen" radius: 10 border.color: "black" border.width: 1 Text { id: _firstText anchors.centerIn: root text: "1" font { pointSize: Math.min(root.width, root.height) / 3 bold: true } } }
Gives the following error:
Project ERROR: Unknown module(s) in QT: quick
And the second code through the console application: main.cpp:
#include <iostream> using namespace std; int main() { cout << "Hello wolrd" << endl; return 0; }
Gives the following error:
13:23:56: Starting /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test ... 13:23:56: An unknown error in the process occurred. 13:23:56: Cannot start the terminal emulator "xterm", change the setting in the Environment options. 13:23:56: /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test exited with code -1
What to do? everything was running great on windows
-
@DavidIT said in How do I run a program in QT creator?:
Installed the QT creator program
Did you also install Qt? If so how and which modules?
-
@jsulm said in How do I run a program in QT creator?:
Did you also install Qt? If so how and which modules?
I have so far installed only this command in Linux RED hat 8.
dnf install qt-creator
I haven't installed any modules yet. And if necessary, which modules should be installed?
-
@DavidIT QtCreator is just an IDE.
If you want to use Qt you have to install it first.
Which modules to install depends on what you need and how Qt is packaged by your Linux distribution.
From your code you at least need QtQuick module. -
@jsulm said in How do I run a program in QT creator?:
Please check what other Qt packages your Linux distribution provides.
dnf list | grep qtquick
qt5-qtquickcontrols.x86_64 5.15.1-1.el7 @base
kqtquickcharts.i686 19.12.1-1.el7 base
kqtquickcharts.x86_64 19.12.1-1.el7 base
qt5-qtquick1.i686 5.7.1-2.2bc722agit.el7 base
qt5-qtquick1.x86_64 5.7.1-2.2bc722agit.el7 base
qt5-qtquick1-devel.i686 5.7.1-2.2bc722agit.el7 base
qt5-qtquick1-devel.x86_64 5.7.1-2.2bc722agit.el7 base
qt5-qtquick1-examples.i686 5.7.1-2.2bc722agit.el7 base
qt5-qtquick1-examples.x86_64 5.7.1-2.2bc722agit.el7 base
qt5-qtquickcontrols.i686 5.15.1-1.el7 base
qt5-qtquickcontrols-doc.noarch 5.9.2-2.el7 base
qt5-qtquickcontrols-examples.i686 5.15.1-1.el7 base
qt5-qtquickcontrols-examples.x86_64 5.15.1-1.el7 base
qt5-qtquickcontrols2.i686 5.15.1-1.el7 base
qt5-qtquickcontrols2.x86_64 5.15.1-1.el7 base
qt5-qtquickcontrols2-devel.i686 5.15.1-1.el7 base
qt5-qtquickcontrols2-devel.x86_64 5.15.1-1.el7 base
qt5-qtquickcontrols2-doc.noarch 5.9.2-2.el7 base
qt5-qtquickcontrols2-examples.i686 5.15.1-1.el7 base
qt5-qtquickcontrols2-examples.x86_64 5.15.1-1.el7 base -
@DavidIT said in How do I run a program in QT creator?:
qt5-qtquick1
I guess this one and the corresponding devel package.
Maybe you also should install qt5-qtquickcontrols2 and the corresponding devel package?