Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!mcsun!hp4nl!phigate!ehviea!sun4dts!derek From: derek@sun4dts.dts.ine.philips.nl (derek) Newsgroups: comp.lang.pascal Subject: Re: Linking Turbo Pascal with Microsoft C Library Message-ID: <744@sun4dts.dts.ine.philips.nl> Date: 25 Jun 91 10:49:49 GMT References: <27280@adm.brl.mil> Lines: 46 A893700%CUCSC.BITNET@yalevm.ycc.yale.edu (Dominic Chow, The Chinese University of Hong Kong) writes: >Does anyone know how to link Turbo Pascal program with Microsoft C >Libraries? >I recently got a library written in Microsoft C (6.00 I think) and I know >to make use of some of the routines in my Turbo Pascal program. I try to >extract the related object modules and $L into the program but it doesn't >work. It won't. Microsoft C is quite incompatible with TP (IMHO) unless something has changed, which I doubt. It seems there's some kind of headers and things at the assembly end that aren't allowed by TP with the $L statement. Sorry about being vague about this - I don't have the facts to hand - just trust me - they don't fit together. However, all is not lost. There is something you can do if you have the source, with a small amount of tweaking, there is a chance they will compiler in Turbo C. I understand that Borland have improved the interface between TP6 and TPC - there were severe restrictions with TP5.0 (and 5.5 I think, although I never had that version). I've yet to try this out, although I have tried out TP5.0 and TPC. And the latter can do some useful things. However, a big caveat - unless you have the run-time libraries source for the C libraries, you cann't use C library calls, you can use the pascal equivalents. Sound complicated - it is, so only worth doing if the C code is really useful. The other option is to convert the C code to pascal. There is a C to Pascal program available. I have also written a rather elementary sed script to do the donkey work of the simple lexical translation ({ to begin, = to :=, == to =, etc.) If the net is interested, I'll post it - it's not very big (nor, incedent- ally is it complete). >Thanks in advance. You're welcome, if this _was_ any use. >Dominic Chow, >Computer Services Centre >The Chinese University of Hong Kong >A893700@CUCSC.BITNET Best Regards, Derek Carr DEREK@DTS.INE.PHILIPS.NL Philips IE TQV-5 Eindhoven, The Netherlands Standard Disclaimers apply.