KDevelop4/FAQ/uk: Difference between revisions

From KDE Wiki Sandbox
(Created page with "=== Як створити консольну програму? ===")
(Created page with "Скористайтеся пунктом меню <menuchoice>Проект -> Створити за шаблоном</menuchoice>. Виберіть пункт <menuchoice>C++ ->...")
Line 11: Line 11:
=== Як створити консольну програму? ===
=== Як створити консольну програму? ===


Go to <menuchoice>Project -> New from template</menuchoice>. Select <menuchoice>C++ -> No GUI (Cmake) -> Simple CMake-based C++ application</menuchoice> and edit the name on the bottom of the window and click <menuchoice>Next</menuchoice>.  
Скористайтеся пунктом меню <menuchoice>Проект -> Створити за шаблоном</menuchoice>. Виберіть пункт <menuchoice>C++ -> No GUI (Cmake) -> Проста заснована на CMake програма C++</menuchoice>, змініть назву у нижній частині вікна і натисніть кнопку <menuchoice>Далі</menuchoice>.  


Then appears <menuchoice>Version Control System</menuchoice>. Select <menuchoice>None</menuchoice> and click <menuchoice>Finish</menuchoice>.
Then appears <menuchoice>Version Control System</menuchoice>. Select <menuchoice>None</menuchoice> and click <menuchoice>Finish</menuchoice>.

Revision as of 18:12, 9 April 2011

Other languages:

Поширені питання щодо KDevelop4

Відеодемонстрації

http://blip.tv/file/4437001

За допомогою цієї відеодемонстрації ви зможете познайомитися з прийомами створення проекту, збирання та виконання проекту та виконання базових завдань з зневаджування (діагностики).

Як створити консольну програму?

Скористайтеся пунктом меню Проект -> Створити за шаблоном. Виберіть пункт C++ -> No GUI (Cmake) -> Проста заснована на CMake програма C++, змініть назву у нижній частині вікна і натисніть кнопку Далі.

Then appears Version Control System. Select None and click Finish.

Then it asks you to configure build. Click Ok. Now you should have new project visible on Projects list. You can build it by pressing F8 or selecting Project -> Build Selection.

To debug an application you must add launch configuration. This is done from Run-> Configure Launches.

Add new launch by pressing +. You need to edit the Project Target field to point a executable binary. It is same as your project name usually. Or you can just select executable to point the binary. You can also edit the launch name to be more informative than New Native Application Configuration by selecting it on left Launch Configurations list and pressing F2. Apply changes pressing Ok. Then you can add breakpoint to source code with right click -> Toggle Breakpoint. Debugging starts with Run -> Debug launch. On bottom of the screen you can select gdb console tab, and you can use enter commands gdb console.

How do I import an existing project?

Go to Project -> Open/Import project and select the folder of your project. Alternatively select your main makefile or CMakeLists.txt. Follow the wizard.

How do I setup KDevelop to run my application?

Go to Run -> Configure Launches, select your project to the left, press the plus-button. Make sure the type of the new launch configuration (give it a proper name!) is Native Application. Now go to the Project target field to the left and type in the path to your target. Start with your projects name, it has auto completion.

Note
We are well aware that this is a mess and needs to be improved...


How do I debug my application in KDevelop?

If you setup a launch configuration (see above) you should be able to run that in debug mode as well.

Note
Make sure you build with debug symbols enabled. The default for new CMake projects is the Debug type, hence it should hopefully work out-of-the-box.


How do I get pretty printed variable contents while debugging?

Make sure your ~/.gdbinit looks similar to this:

python
import sys
sys.path.insert(0, '/home/milian/projects/compiled/kde4/share/apps/kdevgdb/printers')

from qt4 import register_qt4_printers
register_qt4_printers (None)

from kde4 import register_kde4_printers
register_kde4_printers (None)

from libstdcxx import register_libstdcxx_printers
register_libstdcxx_printers (None)

end

Of course you have to adapt the path to point to the pretty printers.

What kind of build environments does KDevelop 4 support?

cmake, any other make-file based project via custom makefile, generic...

How do I use Subversion from within KDevelop 4?

For subversion support you need to have it enabled on compile time. If that is the case, then you can right click your project files and find subversion item from the pop-up menu. There you can find common tasks, like Update and Commit.

Where is search/replace in files ?

Starting with version 4.2, KDevelop ships by default with a search/replace in files plugin. Access it via the menu or from the context menu, e.g. in project view or on a selection in the editor.

What are workingsets and how do I use them?

Todo