Sams Teach Yourself C in 21 Days

(singke) #1

  1. Link list2101.obj, calc.obj, and any needed functions from the standard library to
    create the final executable program list2101.exe.


596 Day 21

If you are using an integrated development environment, you can often create a project that
takes care of compiling multiple source files for you. For example, if you are using the Dev-C++
compiler that came with this book, you can compile the previous listings using the following
steps:


  1. Open Dev-C++

  2. Select File | New Project. You will be presented with the dialog box presented in Figure
    21.1.

  3. Select C project and then click on Console Application. You will be presented with the
    New Project Name dialog as shown in Figure 21.2.

  4. Enter the name of your project such as, List2101. You will be asked to save this file.

  5. The IDE will be opened with an untitled C file in it as shown in Figure 21.3. You can either
    type the code for one of the files into this or you can simply close the file. If you enter the
    code, you’ll want to save the file. You can then enter the other two source files by select-
    ing Project | Add Source File.

  6. If you already created the source files, then you can add them to the project you just cre-
    ated. Do this by selecting Project | Add to project. You can then select the three files.
    These will be added to the IDE.

  7. Compile the project the same way you’ve been compiling your source files before.
    For more on compiling projects with Dev-C++, see the help files.


FIGURE21.1
Dev-C++ New Project
Dialog.

FIGURE21.2
Dev-C++ New Project
Name.

33 448201x-CH21 8/13/02 11:16 AM Page 596

Free download pdf