![]() |
Anjuta Manual version 0.1Copyright (c) Kh. Naba Kumar Singh |
Contents(Top) | Index | Shortcuts |
PREV: Special Operations on files | UP: contents | NEXT: Executing the Program |
Once you have written a C/C++ program you would like to build and run it. To compile the current file (it should be a c/c++ source file), click the compile button in the extended toolbar or activate the menu item Build/Compile or press F9. The message window will appear and list all the messages including any compilation error. You can double click on the error lines (they are red colored) to go to that perticular line where the error is. You can define macros, specify include paths and set the compiler options if you so wish. Compiling a file will save your file first and then compile.
Compiling a file does not build an executable. It simply genarates an object (*.obj) file which is later linked to build the executable.
So, to build a file, click the build button in the extended toolbar or activate the menu item Build/Build or press F10. This will again display the message window listing all the messages that are encountered during the build. The build process will link your object file with libraries and generate the executable (of course, on a successful build only). You can specify the libraries to link with your file in compiler options/libraries.
Remember, the build process will compile your file first if the object file is not upto date or it has not yet been generated. That means, you can directly build a file without first compiling it. It doesn't make sense to put a seperate step which is automatically taken care of. But when you are dealing with a project rather then a single file, you will discover that compiling and building a project are entirely two different birds.