Adding a File to the Project

As you develop a project, you will occasionally add new modules. For example, you can add the object file SETARGV.OBJ to the COUNT project so that the COUNT program accepts wildcards on the command line.

·To add SETARGV.OBJ to your project:

1.From the Project menu, choose Edit Project.

The file and directory navigation lists in this dialog box work in exactly the same way as those in the Open File dialog box. Choose the parent directory symbol (..) in the Drives / Dirs list box to move up the directory tree. To move down the tree, choose the destination directory.

2.Change to the directory that contains your C libraries.

Notice that the directory displayed after the label File List reflects the directory change.

3.Make sure the File Name text box contains *.* or *.OBJ.

4.Select SETARGV.OBJ in the File List box.

5.Choose the Add / Delete button to add the file to the project.

6.Since SETARGV.OBJ is not a source file and cannot have include dependencies, you can turn off the Set Include Dependencies check box. If this check box is left on, PWB regenerates the dependencies for all the files in the project.

7.Choose Save List.

SETARGV.OBJ is now part of the project. However, if you build the program now, the linker displays the message:

error L2044: __setargv : symbol multiply defined, use /NOE

The linker produces this error because SETARGV.OBJ redefines entry points in the standard run-time library. You must change linker options to disable extended dictionary searching (that is, use the /NOE option).

·To change the linker options:

1.From the Options menu, choose LINK Options.

2.Choose Additional Global Options.

3.Turn on the No Extended Dictionary Search in the Library check box.

4.Choose OK to close the Additional Global LINK Options dialog box.

5.Choose OK to close the LINK Options dialog box and use the new options.

You are now ready to build COUNT with the new command-line processing.

·To build the modified project:

1.From the Project menu, choose Rebuild All.

PWB displays the message:

Current directory is not the project directory.

Change to project directory?

You received this message because you changed the current directory to the directory with the C libraries when you added SETARGV.OBJ.

2.Choose OK to switch to the project directory and build the project.

You can run the COUNT program as before by choosing Execute from the Run menu. To see how the program works with the new command-line processing, you can specify *.C as the argument.