๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4124

Re: TurboC++ link question...

#4124
From: anto
Date: Fri, 04 Jan 1991 14:12
29 lines
1240 bytes
In article <4296@mindlink.UUCP>, a563@mindlink.UUCP (Dave Kirsch) writes:
>> wallis@labc.enet.dec.com writes:
>>
>> If you are using Turbo C++ (as opposed to Turbo C) you should define the
>> prototype for the assembler routines as extern "C". For example:
>> 
>> extern "C" void line(int, int);
>> 
>> I don't have my manuals with me, but, I'm fairly sure of the above syntax.
> 
> You must have been a Fortran programmer, as that is the syntax you gave, which
> is incorrect.  The syntax should be:
> 
> extern cdecl void line(int, int);
> 

The first one is correct. It's a C++ syntax, _NOT_ C. Actually it's either:

extern "C" void line (int, int);

.. or

extern "C" { void line (int, int); }

You can use the latter if you want to put more than 1 function prototype
between the braces (if you have more than 1 C function you want to use in a C++
program).

Anto.
Technical Details
Message-ID: <1991Jan4.141848.44213@vaxb.acs.unt.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!vaxb.acs.unt.edu!anto
References: <4296@mindlink.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!vaxb.acs.unt.edu!anto
From: anto@vaxb.acs.unt.edu
Newsgroups: comp.os.msdos.programmer
Subject: Re: TurboC++ link question...
Message-ID: <1991Jan4.141848.44213@vaxb.acs.unt.edu>
Date: 4 Jan 91 14:12:48 GMT
References: <4296@mindlink.UUCP>
Organization: รฟรฟรฟรฟ
Lines: 29