KDevelop5/Manual/Running programs: Difference between revisions
m (Removing bug so it can be the same as the docbook at git.) |
John Hayes (talk | contribs) (Updated photos and some minor text edits to match current features and look) |
||
Line 5: | Line 5: | ||
<!--T:2--> | <!--T:2--> | ||
Once you have built a program, you will want to run it. To do this, need to configure ''Launches'' for your | Once you have built a program, you will want to run it. To do this, need to configure ''Launches'' for your project. A ''Launch'' consists of the name of an executable, a set of command line parameters, and an execution environment (such as "run this program in an external terminal", or "run this program in the debugger"). | ||
</translate><span id="Setting up launches in KDevelop"></span><translate> | </translate><span id="Setting up launches in KDevelop"></span><translate> | ||
Line 12: | Line 12: | ||
<!--T:4--> | <!--T:4--> | ||
[[ | [[File:Kdevelop-nano-launch-config.png|500px|thumb|center]] | ||
<!--T:5--> | <!--T:5--> | ||
To set this up go to menu item <menuchoice>Run -> Configure launches</menuchoice>, highlight the project you want to add a launch for, and click on the {{Plus}} button. Then enter the name of the executable, and the path where you want to run the program. If running the executable depends on building the executable and/or other libraries first, then you may want to add them to the list at the bottom: select <menuchoice>Build</menuchoice> from the dropdown menu, then hit the {{Icon|folder}} symbol to the right of the textbox and select whatever target you want to have built | To set this up go to menu item <menuchoice>Run -> Configure launches</menuchoice>, highlight the project you want to add a launch for, and click on the {{Plus}} button. Then enter the name and location of the executable, and the path where you want to run the program. Any required command line arguments if any, can be specified in the <menuchoice>Arguments:</menuchoice> edit box. If running the executable depends on building the executable and/or other libraries first, then you may want to add them to the list at the bottom: select <menuchoice>Build</menuchoice> from the dropdown <menuchoice>Action:</menuchoice> menu, then hit the {{Icon|folder}} symbol to the right of the textbox and select whatever target you want to have built. While you're there, you may as well also configure a debug launch by clicking on the <menuchoice>Debug</menuchoice> symbol and adding the name of the debugger program; if this is the system's default debugger (e.g. '''gdb''' on Linux), then you don't need to do this step. | ||
<!--T:6--> | <!--T:6--> | ||
[[ | [[File:Kdevelop-after-nano-run.png|650px|thumb|center]] | ||
<!--T:7--> | <!--T:7--> | ||
You can now try to run the program: Select <menuchoice>Run -> Execute Launch</menuchoice> from '''KDevelop's''' main window menu (or hit <keycap>Shift + F9</keycap>) and your program should run in | You can now try to run the program: Select <menuchoice>Run -> Execute Launch</menuchoice> from '''KDevelop's''' main window menu (or hit <keycap>Shift + F9</keycap>) and your program should run in an external ''terminal window'' of '''KDevelop'''. The picture above shows the result: The new <menuchoice>Run</menuchoice> tool subwindow at the bottom shows the output of the program that is being run, in this case of the '''''nano''''' program. | ||
<!--T:8--> | <!--T:8--> | ||
Line 32: | Line 32: | ||
</translate> | </translate> | ||
{| class=" | {| class="wikitable" style="border:1px solid" width="500" | ||
! colspan="2" style="background:#ffff99; text-align:center" |<translate> <!--T:13--> | ! colspan="2" style="background:#ffff99; text-align:center" |<translate> <!--T:13--> | ||
Running a program | Running a program | ||
|-style="font-weight:bold; text-align:left;" | |||
! width=15% style=" border:1px solid gray;"| Shortcut | |||
! width=85% style=" border:1px solid gray;"| Result | |||
|- | |- | ||
<!--T:14--> | <!--T:14--> | ||
| <keycap>F8</keycap> | | <keycap>F8</keycap> | ||
| Build (call make) | | Build (call make) | ||
|- | |- | ||
<!--T:15--> | <!--T:15--> | ||
| <keycap>Shift + F9</keycap> | | <keycap>Shift + F9</keycap> | ||
| Run | | Run | ||
|- | |- | ||
<!--T:16--> | <!--T:16--> | ||
| <keycap>F9</keycap> | | <keycap>F9</keycap> | ||
| Run program in the debugger; you may want to set breakpoints beforehand, for example by right-clicking with the mouse on a particular line in the source code | | Run program in the debugger; you may want to set breakpoints beforehand, for example by right-clicking with the mouse on a particular line in the source code | ||
|- | |||
</translate>|}<translate> | </translate>|}<translate> |
Revision as of 19:35, 1 April 2020
Running programs in KDevelop
Once you have built a program, you will want to run it. To do this, need to configure Launches for your project. A Launch consists of the name of an executable, a set of command line parameters, and an execution environment (such as "run this program in an external terminal", or "run this program in the debugger").
Setting up launches in KDevelop
To set this up go to menu item button. Then enter the name and location of the executable, and the path where you want to run the program. Any required command line arguments if any, can be specified in the edit box. If running the executable depends on building the executable and/or other libraries first, then you may want to add them to the list at the bottom: select from the dropdown menu, then hit the symbol to the right of the textbox and select whatever target you want to have built. While you're there, you may as well also configure a debug launch by clicking on the symbol and adding the name of the debugger program; if this is the system's default debugger (e.g. gdb on Linux), then you don't need to do this step.
, highlight the project you want to add a launch for, and click on theYou can now try to run the program: Select Shift + F9) and your program should run in an external terminal window of KDevelop. The picture above shows the result: The new tool subwindow at the bottom shows the output of the program that is being run, in this case of the nano program.
from KDevelop's main window menu (or hit
Some useful keyboard shortcuts
Running a program | |
---|---|
Shortcut | Result |
F8 | Build (call make) |
Shift + F9 | Run |
F9 | Run program in the debugger; you may want to set breakpoints beforehand, for example by right-clicking with the mouse on a particular line in the source code |