• Keine Ergebnisse gefunden

Creating a project

Im Dokument or an (Seite 39-43)

26

To create a project,

1. Choose Project I New project. Type a path and a name (eight characters or less) for the project, then press Tab. You can also use the Browse button to select a path to the project file.

2. Type a name for the first target in your project. This is usually the name of the program you want to create (the .EXE or .DLL).

Borland C++ Users Guide

You can use TargetExpert to change these attributes.

See the DOS Reference for more information on these libraries.

3. Choose a target type:

• Application is a normal.EXE file.

• Dynamic Library is a .DLL file.

• EasyWin is.a character-mode application that runs under Windows . .• Static Library is a .LIB file.

• Import Library is a .LIB file.

• Windows Help is a help file (.HLP) that you usually access from a Windows application (.EXE).

4. Choose a platform for your target:

• Windows 3.x is a 16-bit Windows application.

• Win32 is a 32-bit Windows NT application.

• DOS Standard is a 16-bit DOS application.

• DOS Overlay is a 16-bit DOS application that uses overlays.

5. If your application is for DOS, check

• Floating point to link in FP87.lib.

• Emulation to link in EMU.LIB.

• No Math to link in the DOS math libraries.

• Alternate startup to link in COFx.OBJ, which makes SS==DS for all memory models.

• Check any standard libraries you want to use in your application.

Some libraries are checked by default when you choose a target type (you can't uncheck some of these because they are required for the type of target you're creating). If dynamic and static libraries exist, you can choose which type you want to use (Dynamic is usually the default).

• OWL uses th~ ObjectWindows libraries. See the Object Windows Programmer's Guide for more information.

• Class Library uses the Borland container class libraries discussed in the Programmer's Guide.

• Runtime uses the run-time libraries listed in the Library Reference.

• BWCC uses the Borland Windows Custom Control libraries. See Appendix B ..

• BGI uses the Borland Graphics Interface (available for DOS applications only). See the online file UTILS.TXT.

6. Check Diagnostic if you want to use a diagnostic version of the libraries (this is available for Class Libraries and ObjectWindows; see the

Creating a multiple-target project

To include a DLL for an application in a project, place the DLL

node under the .EXE node.

28

ObjectWindows documentation for more information on diagnostic versions of its libraries).

7. Check Multithread if you want to use the multithread version of the run-time library. Multithread is available only if your platform is Win32.

8. Choose a memory model for your target (Target Model). Models change depending on the target type. .

9. Click OK to create the project. A graphical representation of your project appears in a project window. You can change the target attributes you set in steps 2-8 by using the project manager's SpeedMenu (right-click a node or press AIt+F10).

The project manager creates a target with one or more dependents-the default dependents depend on the target type. To view which dependents are added for a target type, click the Advanced button in the New Project dialog box. You can select other dependent nodes, then click OK. For DOS application, you can select how you want the stack and data segments to work.

After you create the initial target for a project, you can add, delete; or rearrange nodes and targets to your project. See page 31 for more information on editing projects.

Creating multiple-target projects is similar to creating projects with one target:

1. Create a project using the steps described on page 26.

2. Choose Project I New target to add a second target to your application.

The New Target dialog box appears.

3. Type a name for the second target and choose a target type (Standard is the default). Choose OK. The project manager adds a new target to your project just as it does for the first target in a project.

To view a sample project with two targets, open the file MULTITRG.IDE in the EXAMPLES\IDE\MULTITRG directory. This project file builds two versions of the WHELLO program (one that is 16-bit and one that is 32-bit).

The project file contains a text file that describes how to use two or more targets in one project file.

With more than one target in a project, you can choose to build a single target, multiple targets, or the whole project. See page 30 for information on building projects.

Borland C++ Users Guide

Converting old projects

Converting projects to makefiles

Changing the' Project View

The project manager for this release can load and use projects from previous versions of Borland C++ for Windows. Choose Project I Open project, then type the name of the old project file. You can also change the search attributes from * . IDE to * . PRJ to list the old 3.0 and 3.1 projects.' The project manager converts the old project to a new one. Be sure to save the new project if you want to keep using it with this version of Borland C++. To save the project, choose Options I Save. Make sure Project is checked, then click OK. The new project is saved with the old name and the new .IDE extension.

You can convert Borland C++ project files (.IDE) to makefiles (.MAK) from the IDE. To convert a project file to a makefile,

1. Open the project file (.IDE) you want to convert.

2. Choose Project I Generate Makefile. The IDE generates a makefile with the same name as the project file, but with the extension .MAK. The IDE displays the new make file in an editor window.

The project window, by default, displays the project node, target, and dependents. You can control the display by using the Options I Environment dialog box.

1. Choose Options I Environment. The Environment Options dialog box appears.

2. Choose Project View. A list of options appears.

3. Check or uncheck the options you want. A sample node called WHELLO

changes as you select or deselect options. This sample shows you how all nodes will appear in the project window. The following list describes each option:

Build translator displays the translator used on the node.

Code size displays the total size in bytes of code segments. This information appears only after the node has been compiled.

Data s~ze displays the size in bytes of the data segment. This information appears only after the node has been compiled.

Description displays a description of the node. You type the description using the Edit node attributes dialog box from the SpeedMenu.

Location lists the path to the source file associated with the node.

Name displays the name of the node.

Number of lines displays the number of lines of code in the file

associated with the node (note that this displays only after you compile the code).

Node type describes the type of node (for exainple, . cpp or . c).

Style Sheet names the Style Sheet attached with the node.

Output names the file (and the path to that file) that the node creates when it is translated. For example, a .CPP node creates an .OBJ file.

Show runtime nodes displays the nodes the project manager uses when the project is built. For example, it lists startup code and libraries.

Show project node displays the node for the entire project. The project node is built when you choose Project I Build all. Note that all targets are dependents of the project node.

Im Dokument or an (Seite 39-43)