Linking




Document: Software Engineering 1: Course Notes

next Running the Program
up Hints
previous The Message Window

Linking

Once you have got a clean compilation, you can go on to the linkage phase. This is where, if necessary, certain standard "library" procedures or routines are added to the code produced by compiling your program. These standard routines deal with things like reading data in from from the keyboard, or writing it out to a disk file; or calculating mathematical functions such as sin() and log() etc. There are a very large number of such standard routines, or "building blocks", available. This saves individual software engineers from having to develop these standard procedures themselves from scratch.

You will not be able to actually run or execute your program unless it can be successfully linked. The output of the linkage phase is called the executable file. This will normally be stored in a file with the same name as the source file, but the extension .EXE. In our case then, the executable file will be called WOTCOST.EXE.

As with object file(s) you will not need to copy executable file(s) onto your diskettes for backup. They can always be recreated whenever necessary..

To carry out the linkage, first ensure that the (relevant) edit window is active. Then drop down the Compile menu. Select the Link EXE file menu item.

As with compilation, problems may be detected during the linkage phase, and messages may be displayed in the edit window. In this case, however, the IDE will not be able to even guess where the problem is located in the original source file. This is because, at linkage time, the IDE is really only dealing with the .OBJ file: it is no longer dealing with the source file. It cannot relate problems now arising with the .OBJ file back to some particular location in the source file: the relationship between these two files is too complex to allow this. But: you can rest assured that, if the linkage phase results in messages in the Message window, there really is something wrong with your source program.

Do not go past the linkage stage until you have managed to get a completely "clean" link - with absolutely no error or warning messages. If you find that you simply cannot make any sense of some linkage message (after making a sincere effort!) then call the demonstrator for help.




Document: Software Engineering 1: Course Notes

next Running the Program
up Hints
previous The Message Window



McMullin@ugmail.eeng.dcu.ie
Wed Mar 15 10:20:49 GMT 1995