Compile and Build

5.2.1. Compiling a file

In a project, individual source files can be compiled separately into objects (*.o files). Although you do not have to worry about these object files, sometimes it is handy to compile a file first (for example, to make sure there are no syntax errors). Building a whole project can take a lot of time, especially in the case of larger and more complex applications. Therefore, you will probably go through a series of edit-compile iterations while developing a project.

To compile a file, choose the menu item Build ▸ Compile or press F11. This will compile the active file.

5.2.2. Building an executable

Anjuta has no separate link command, simply because it is not necessary. The build process will compile all source files and link them together along with the necessary libraries. The build command will not recompile those files which are already up-to-date (this is called the dependency check). If you have already compiled all files individually, then the only thing the build step performs is the link. If you have already built the project and no dependent file has been modified, even the link stage will be skipped.

So how exactly does the dependency check influence project development? If you have modified a file, then all of the source files that depend on the modified file are recompiled. All files (not just the object files and executable) in the project are checked for these dependencies during the build process. If it is found that a particular file is dependent on some other file which has been modified, then that file will be regenerated.

Can you imagine how your life (as a programmer) would be if the dependency check were not there? If you cannot answer just yet, then you will find out when you start developing big projects!

Build ▸ Build will build all files in the directory of the currently active file.

Build ▸ Build Project will build the whole project — all subdirectories are built recursively.