From: "Charles LaCour" 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: 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 Precedence: bulk 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?