BRender x86 Installation Guide:Configuring Your Compiler:2.2 Compiling Windows Programs
Next|Prev|Up
Watcom C V10/10.5
Borland C V4.5
VISUAL C V2.2/4.0

2.2 Compiling Windows Programs


The following sections guide you through compiling and running the sample BRender program simpview from within the Watcom, Borland and Visual C IDE's. It is assumed that you have installed BRender in the default directory. Simpview files can be found in the directory C:\BRENDER\SAMPLES\WIN\SIMPVIEW.

Watcom C V10/10.5

1. Start the IDE and create a new project (pull down the File menu and select New Project) called simpview(.wpj), in the directory C:\BRENDER\SAMPLES\WIN\SIMPVIEW.

2. Select Win 32 as the target environment. The image type is Windowed Executable [.exe].

3. Add the following source files (pull down the Sources menu and select New Source) to the project:

app.c, buffer.c, dispatch.c, main.c, mattub.c, world.c, app.rc

The .c and .rc files can be found in the \SIMPVIEW directory.

The .lib files can be found in C:\BRENDER\LIB. Note that the Fixed Point, Register Calling BRender libraries have been selected (see Table 1). Select one of the other supported options if you would prefer.

4. Select 4-byte alignment:

Options

C Compiler Switches

File Option Switches

Source Switches

(pull down the Options menu and select C Compiler Switches, pull down the File Option Switches sub-menu and select Source Switches, select 4 byte alignment).

5. To tell Watcom where to find BRender Header Files, add c:\brender\inc to the Include directories: option under File Option Switches.

Options

C Compiler Switches

File Option Switches

Include directories:

6. Make sure the target processor matches your machine and the calling convention (register or stack) is consistent with the selected BRender libraries.

Options

C Compiler Switches

File Option Switches

Memory Model and Processor Switches

Target Processor

7. Compile and Run the sample program.

Borland C V4.5

1. Create a new project called simpview(.ide), in the directory C:\BRENDER\SAMPLES\WIN\SIMPVIEW.

Project

New Project

Project Path and Name

2. In the same window, select WIN32 as the target. Accept the default target type (Application) and other default settings.

Platform

3. Delete default nodes simpview.cpp, simpview.def and simpview.rc if present (highlight nodes, then press [Delete]). Add the following source files (press [Insert] then select files):

app.c, buffer.c, dispatch.c, main.c, mattub.c, world.c, app.rc

The .c and .rc files can be found in the \SIMPVIEW directory.

The .lib files can be found in C:\BRENDER\LIB. Note that the Fixed Point BRender libraries have been selected (see Table 1). Fixed point arithmetic is faster, though less accurate, than floating point arithmetic.

4. Select 4-byte alignment:

Options

Project

32-bit Compiler

Processor

Data alignment

5. To tell Borland where to find BRender Header Files, add c:\brender\inc to the Include Source Directories option under Directories.

Options

Project

Directories

Source Directories

Include:

6. Compile and Run the sample program.

VISUAL C V2.2/4.0

Note that you must be running Windows NT or Windows 95 to compile BRender programs using VISUAL C.

1. Start the IDE and create a new project called simpview(.mak), in the directory C:\BRENDER\SAMPLES\WIN\SIMPVIEW.

File

New

2. Add the following source files:

app.c, buffer.c, dispatch.c, main.c, mattub.c, world.c, app.rc, mlibcmnt.c

The above files can be found in the \SIMPVIEW directory.

3. To tell VISUAL C where to find BRender Header and Library Files, add c:\brender\inc and c:\brender\lib to the Include Files and Library Files options, respectively:

Tools

Options

Directories

Include Files

Library Files

4. Select Win32 Fixed (Release) as the Target:

Target

5. Compile and Run the sample program.


Generated with
CERN WebMaker