Do you want to do programming in Linux? Probably you need C++ programming environment in Linux. Then you need a GUI programming toolkit for C++.You can choose C++ with Qt Framework programming environment in Ubuntu. I will show you how to get them all (complete with C++ library and an IDE) Ubuntu 15.04. Magically, you get them all just by installing Qt Creator.
|Qt Creator, C++, and Qt Framework|
The build-essential is a metapackage (package that pull another packages) to install all C++ programming tools in Ubuntu. If you install it, you will get GNU g++ (a most used C++ compiler), GNU gcc (a most used C compiler), make (a build utility), libc-dev (a collection of GNU C Library), and dpkg-dev (a collection of dpkg tool for developing Debian package). In Ubuntu 15.04, you already got them all pre-installed. You do not need to install it again.
In Ubuntu 12.04, you still need to install build-essential by command
sudo apt-get install build-essential
Install Qt Creator
By GUI, you can use Ubuntu Software Center to search qt creator and install it.
|Installing Qt Creator by GUI|
By Terminal, you can use this command:
sudo apt-get install qtcreator
|Installing Qt Creator by Terminal|
Install Qt Framework Complete Documentation
By default, you get no documentation by just installing qtcreator package. If you need Qt examples, demos, complete documentation, so you can read it inside Qt Creator offline, install them by this command.
sudo apt-get install qt5-doc qtbase5-examples qtbase5-doc-html
- qt5-doc: this package contains Qt 5 API Documentation.
- qtbase5-examples: this package contains Qt base 5 examples.
- qtbase5-doc-html: this package contains the HTML documentation for the Qt 5 base libraries
|Qt C++ Program Examples|
Using Qt Creator
For first usage, you can create a C++ GUI program by using Qt Widget Project option in Qt Creator. Actually, you have so many other project templates, but for the first time you should try this first. Create it by menu New File or Project (Ctrl+N) > select Project > select Qt Widget Application > press Choose button > type your project name > next, next, and finish. To compile your C++/Qt project, press Run button (green triangle icon on the left panel) or just Ctrl+R. See picture below.
Using Qt Documentation
1. C++/Qt Examples - After installing those three packages, open Examples section in Qt Creator. You will see many C++/Qt program examples. Click one and you have it. Just run (Ctrl+R) you build and execute it. See picture below.
|Running C++/Qt Example|
|Left Panel Qt API Reference Documentation|
|Complete Qt Framework Documentation|
|Qt Creator IDE Documentation|