KDevelop4/FAQ

From KDE UserBase Wiki
Revision as of 09:14, 10 April 2011 by Claus chr (talk | contribs) (Importing a new version from external source)
Other languages:

KDevelop4 FAQ'er

Skærmbilleder

http://blip.tv/file/4437001

Disse skærmbilleder viser dig, hvordan du kommer i gang med det nyt projekt, hvordan du bygger og kører det samt debugger det.

Hvordan laver jeg et nyt konsolprogram?

Gå til Projekt -> Ny fra skabelon.... Vælg C++ -> No GUI (Cmake) -> Simpel CMake-baseret C++-applikation og skriv navnet forneden i vinduet; klik så Næste.

Nu dukker Versionsstyring op. Vælg Ingen og klik Afslut.

Nu bliver du bedt om at konfigurere en byggemappe. Klik O.k.. Nu skulle et nyt projekt vise sig i listen Projekter. Du kan nu bygge det ved at taste F8 eller vælge menuen Projekt -> Byg valgte.

For at debugge et program skal du tilføje en opstartskonfiguration. Dette gøres fra menuen Kør -> Indstil opstarter.

Tilføj en ny opstarter ved at klikke på +. Du skal redigere feltet Projektmål til at pege på en kørbar fiol. Den har normalt det samme navn som dit projekt. Du kan også bare lade Kørbar pege på filen. Du kan også ændre navnet på startindstillingen til noget mere informativt end Ny konfiguration af Native applikation ved at vælge det til venstre i listen Opstartsindstillinger og taste F2. Acceptér ændringerne ved at klikke O.k.. Nu kan du tilføje stoppunkter ved at højreklikke i kildekoden og vælge Slå stoppunkt til/fra. Fejlsøgning startes, når du vælger menuen Kør -> Start fejlsøger. Forneden i vinduet kan du vælge fanebladet GDB, og du kan skrive kommandoer til gdb-konsollen.

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