Contributor: SWAG SUPPORT TEAM TP 4.0 5.0 5.5 - LINKING TURBO C OR ASSEMBLER .OBJ OBJECT FILES Q. Are the .OBJ files generated by Turbo C and Turbo Assembler compatible with 4.0+? A. Yes. You can write Turbo C or Turbo Assembler routines and link the .OBJ files into your Turbo Pascal programs by using the {$L} compiler directive. See the CTOPAS example on the distribution diskette. TP 4.0 5.0 5.5 - OBJECT FILE CREATION Q. Does Turbo Pascal create object files that can be linked into other languages? A. Turbo Pascal 4.0+ generates .TPU (Turbo Pascal Unit) files, not .OBJ files. We've made that decision for many reasons: 1. TP 4.0+'s .TPU files are smaller than .OBJ's, and they contain symbolic information important to the support of Pascal's strict type conventions (types, constants, etc.). 2. .TPU files allow "smart linking" - elimination of unused code and data on a procedure-by-procedure basis. 3. .TPU's allow built-in project management through version 4.0+'s Make and Build commands. 4. .TPU's allow faster compilation speeds (34,000 lines per minute on a PS/2 Model 60). TP 4.0 5.0 5.5 - LINKING .OBJ OBJECT FILES FROM OTHER ASSEMBLERS Q. Will the $L compiler directive work for compiler object files other than assembler? A. That depends on the language. TURBO requires all the code in the .OBJ to be in *one* CODE segment, and all the data to be in *one* DATA segment. With assembly language that's easy, but it may not work with some high-level language compilers. You can use Turbo C to generate .OBJ files for use by Turbo Pascal programs. An example, CPASDEMO.PAS is included on the distribution disks. TP 4.0 5.0 5.5 - INTERFACING MODULES WRITTEN IN MICROSOFT C Q. Can I link modules, written in Microsoft C, with Turbo Pascal programs? A. Yes. M/S C .OBJ modules can be linked provided they do not use the C runtime library. The same limitations apply to M/S C modules as to Turbo C modules.