home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7665 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  1.5 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!plutonium.CChem.Berkeley.EDU!matte
  2. From: matte@plutonium.CChem.Berkeley.EDU (Matt Rose)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Linking C++ .OBJ's with TP 5.5
  5. Date: 24 Dec 1992 04:59:28 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 28
  8. Message-ID: <1hbg3gINNngk@agate.berkeley.edu>
  9. References: <BzosFE.KA6@eis.calstate.edu>
  10. NNTP-Posting-Host: plutonium.cchem.berkeley.edu
  11.  
  12. In article <BzosFE.KA6@eis.calstate.edu> mparanj@eis.calstate.edu (Milind Paranjpe) writes:
  13. >Hello:
  14. >
  15. >I'm trying to link in functions written in Borland C++ 2.0 into a Pascal
  16. >program (TP 5.5).  I keep getting errors saying that the public symbols in
  17. >the C++ .OBJ file aren't in the CODE segment.  Looking at the C++ manual, all
  18. >the code goes in a segment called _TEXT.  Is there a way to change this so
  19. >TP 5.5 can recognize and use the C++ function??
  20. >
  21. >Thanks,
  22.  
  23. I'm almost certain that your problem is due to name mangling.  Something
  24. C++ does to allow overiding functions.
  25. int funcName(int, int);  
  26. would look like funcName_int_int 
  27. or some ridiculous thing like that.
  28. Anyway, the point is that if you can disable name mangling, there's a
  29. good chance this will fix your problem.  Unfortunately I can't remember
  30. the keyword, and I have the code at home, and I'm leaving tomorow.
  31. But if you can find the word, then the declaration in the C++ code would
  32. look like this:
  33.  
  34. int far pascal _export secretWord funcName(paramList);
  35.  
  36. Now, does anyone out there know the secret word?
  37.  
  38. Good luck
  39. -matt
  40.