MRC/Tutorials/Setting up an IDE: Difference between revisions
No edit summary |
|||
Line 18: | Line 18: | ||
</pre> | </pre> | ||
= Use | = Use Qt Creator for your project = | ||
Now you have installed a proper IDE, you can start to do some real programming! In previous tutorials, we created a C++ project called ''awesome_project'' and went through a little bit of work to get it to build using CMake. Now, that work will pay off: Qt Creator 'understands' CMake, so we can directly load the project. Simply start Qt Creator and: | |||
# | # From the home screen (''Welcome'' tab on the left) select ''Open Project''. | ||
# Navigate to the CMakeLists.txt in your project and open it | |||
# Now, Qt Creator will pop-up a window titled ''Build location''. Remember last tutorial? Qt Creator wants to create a ''build'' directory in which it will store the build files CMake generates. We already created a ''build'' directory (in the root of your project), so we can simply point Qt Creator to this directory. If you removed it for whatever reason, you can simply tell Qt Creator to create a new directory called ''build''. | |||
# | |||
# | |||
# | |||
Now | |||
you | |||
Revision as of 23:44, 28 April 2015
Introduction
To keep the code in your packages clear and manageable, it is advised to use an Integrated Development Environment (IDE) to edit your C++ code. Qt Creator is such an IDE for C++. It has the advantage of understanding you code up to some extend. This means Qt Creator can be used to, e.g., auto-complete names of variables and functions or get compilation error message in a nice way. Also, as was stated in the previous tutorial, it understands CMake, which allows it do be used to compile your project, and even run the resulting executables.
Installing Qt Creator
- Download Qt Creator for Linux:
- Open a terminal, cd to the folder where you downloaded the file (probably ~/Downloads)
- Make the file executable:
chmod +x <INSTALL_FILE>
- Run the installation:
./<INSTALL_FILE>
If you installed Qt Creator in the default path, you can run it by calling:
~/qtcreator-3.3.2/bin/qtcreator
Use Qt Creator for your project
Now you have installed a proper IDE, you can start to do some real programming! In previous tutorials, we created a C++ project called awesome_project and went through a little bit of work to get it to build using CMake. Now, that work will pay off: Qt Creator 'understands' CMake, so we can directly load the project. Simply start Qt Creator and:
- From the home screen (Welcome tab on the left) select Open Project.
- Navigate to the CMakeLists.txt in your project and open it
- Now, Qt Creator will pop-up a window titled Build location. Remember last tutorial? Qt Creator wants to create a build directory in which it will store the build files CMake generates. We already created a build directory (in the root of your project), so we can simply point Qt Creator to this directory. If you removed it for whatever reason, you can simply tell Qt Creator to create a new directory called build.