www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/27/20:02:13

From: "Charles LaCour" <clacour AT MCI2000 DOT com>
Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.djgpp
References: <34ce73e4 DOT 770906 AT news DOT ziplink DOT net>
Subject: Re: using OBJ files with other languages?
Lines: 20
Message-ID: <Oovz.21990$7G1.1509550@news.internetMCI.com>
Date: Wed, 28 Jan 1998 00:58:22 GMT
NNTP-Posting-Host: usr16-dialup43.mix1.bloomington.mci.net
NNTP-Posting-Date: Tue, 27 Jan 1998 19:58:22 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I think people have tried and failed to link C/C++ to Turbo Pascal directly.
I think it might be possible using inline assembly, but I'm not sure.  I
certainly think that it is best to use the extern "C" prefix on your C++
global variables and function names.  This would maintain the C version of
the name and that name will follow and underscore (i.e. _myfunc for myfunc).

Good luck.

Charles

Jeff W./DMT wrote in message <34ce73e4 DOT 770906 AT news DOT ziplink DOT net>...
>I'm trying to write some code in C/C++ and compile it as an object
>file so that I can link it with my turbo pascal code.  I did it once,
>but I don't have the source code to study from since my hard drive
>crashed (again =(.  Sooo, let's say I have a function DoSomething in
>C/C++, and a global variable "Variable".  How would I compile the
>c/c++ code so thta it links properly?  Does it in anyway relate to the
>"extern" keyword or is thta just retarded?


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019