Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!uwm.edu!ux1.cso.uiuc.edu!s.psych.uiuc.edu!amead From: amead@s.psych.uiuc.edu (alan mead) Newsgroups: comp.lang.pascal Subject: Re: C PASCAL INTERFACE Message-ID: <1991Apr5.211211.24087@ux1.cso.uiuc.edu> Date: 5 Apr 91 21:12:11 GMT References: <2941@cod.NOSC.MIL> <2257@wet.UUCP> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 30 seth@wet.UUCP (Seth Olitzky) writes: >In article <2941@cod.NOSC.MIL> vtran@cod.NOSC.MIL (Viet D. Tran) writes: >> >>I have programs that were written in two different languages, Pascal >>and C. Now, I am having trouble combining them together, or linking >>... >A lot depends on what compilers and target machine you are using. Borland >pascal TPU are not compatible with Borland C objects. You will need to >... Actually, I think any .OBJ file can be linked to Turbo Pascal (probably most other popular compilers as well). The problem is whether or not pascal can use the code. The answer is usually yes--Ohlsen and Stoker have a longish chapter on linking C with Turbo Pascal in _Advanced Techniques in Turbo Pascal_ (<- that's only an approximate title :( *But*, the one of the first lines says approximately: "Avoid using any Standard C function calls or else you'll need to buy the Run Time Library in order to get the OBJ file to link to Pascal." Which would seem to limit the practical possibilities. So, I've never done this. I don't know how much of a hassle it turns out to be. Sadly, I know of no Pascal compiler that compiles to .OBJ format; as a result, you cannot link Pascal code into other languages. -alan mead : amead@s.psych.uiuc.edu