Say we have installed QT programs and we want to run Qtcreator from the command line.
What we are need here are only-put a soft link to the qtcreator we have just installed. Here is some simple precedures.
- Once the QT program was installed, open up a terminal and use a text editor such as Nano or gedit to edit your/etc/profile .
- type/copy/paste: sudo-s nano/etc/profile
- Or
- type/copy/paste: sudo-s gedit/etc/profile
- Scroll down to the end of The/etc/profile file and enter the following text below. You want-add this line below-your/etc/profile system wide file So, you'll have the option to compile Qt progr AMS from the terminal line.
- Type/copy/paste:
- path=/opt/qt5.7.0/tools/qtcreator/bin: $PATH
- Export PATH
- The above number highlighted in bold denotes the version number of the Qt SDK so make sure you enter the correct versi on number of the Qt SDK. The Qt SDK is always improving with new version changes. So make sure is mindful of your Qt SDK version number.
- For example, we is using Qt version 5.7.0 In this example, therefore the version number in The/etc/profile Woul D reflect as 5.7.0
- Save the/etc/profile file and exit
- Reload the/etc/profile file by issuing the following command
- type/copy/paste: . /etc/profile
- Make sure you enter a. And then a space in order to reload Your/etc/profile file
- Once the/etc/profile file is reloaded issue the following command you can type the following commands to make sure yo ur Ubuntu Linux System recognizes that the Qt SDK have been accepted by the system PATH.
- type/copy/paste: which qmake
- You should receive a response such as the one below
- /opt/qt5.7.0/tools/qtcreator/bin/qtcreator
- Also Type the following command below:
- type/copy/paste: qtcreator-version
- You should receive a response similar to this:
- QT Creator 4.0.2 based on Qt 5.7.0
- This lets your know that is able to run Qtcreator programs from the command line.
How to run a manually installed program from terminals in Linux/ubuntu