Updated: 2003-01-19 05:50

Compiling at Home and at Algonquin

Last revised: Sunday January 19, 2003 05:50.

The following information is from: "Mitch B." biss0005@algonquincollege.com.

Setting up the Borland IDE

This is necessary when migrating from home to school and vice-versa. The C Language environments may not be the same, and you need to adjust some things to make compiling and linking work correctly.

First, you must set the correct C library path so that Borland's linker can find the library object files on the computer you are compiling on. You do this by selecting the "Options" menu in the title bar, then selecting the "Project" sub-menu.
Once this is done, a window will appear showing the current project settings. On the left, there is a list of things you can configure; you should click on the "Directories" tab if it isn't already there.
After selecting "Directories", the right-hand side will show the current file path for the include directory, the Borland library, and the source directory. One should only need to change the path for the Include and Library directories!
To compile a project at school (assuming you are using Borland 4.5), the directory paths should read:
Include: m:\bc45\include
Library: m:\bc45\lib
To compile a project at home, only these two paths need to be modified, for example:
Include: c:\bc45\include
Library: c:\bc45\lib
For those using Borland Turbo C++ 4.5 at home, something like this may be used:
Include: c:\tcwin45\include
Library: c:\tcwin45\lib

Please note that students who use Turbo C++ at home (like myself) must compile their projects in the 16-bit Windows environment to be able to work on their programs both at home and at school. Borland C++ is backwards compatible, but Turbo C++ is not! Opening a Turbo C++ project in Borland C++ will most likely give you a message warning you of possible compatibility problems. If the target application was set to 16-bit WIN, don't worry, it will work correctly.

The above is all that is required to be able to work at home and at school.

C Programming Suggestion

Here are a few tips on keeping a C programming disk tidy and useful when debugging; especially when using the Borland integrated development environment:

save all source files in a root directory.
any global header files should also be in the same root.
each assignment should have it's own folder under the root
in each assignment folder, you have the main.c file, any specific header file, and any test/data files for that assignment.

That's it! Now, when it's time to create a new project in Borland, all you have to do is make all the required source files part of your project hierarchy.

Example project set-up for Compilers

Here's how I organized my Compilers disk for Assignment #7:

scanner.c, parser.c, stack.c, symtab.c, and global.h in the root of the floppy disk (a:\)
main.c and any input test files in a sub-directory (a:\assign07\)

Here are some of the advantages of organizing your disk this way:

very small .CSM files because there is only 1 copy of a particular source file.
if you need to modify an old program/function you created in assign03, for assign06; you can make the necessary changes and then re-compile and run assign03 to make sure it works the way you want before integrating it with later assignments only to discover major bugs. This makes debugging much easier!
there are many more advantages, but I can't really list them all!
Trust me, this methodology made my life easier in CST8152!

Well, hope this information is useful to you and maybe future Compilers or Intro to C students. If there is something in this text that wasn't clear or if there is something I missed; by all means, send me some email!

Michel Bisson biss0005@algonquincollege.com.

Last revised: Sunday January 19, 2003 05:50.

Web Author: Ian! D. Allen idallen@idallen.ca      Updated: 2003-01-19 05:50

Internet Free Zone Level 1 logo Support free and non-commercial Internet.

Any Browser logo This site works best in Any Browser, a campaign for non-specific WWW.

Creative Commons License logo This work is licensed under a Creative Commons License.