Article View: comp.os.msdos.programmer
Article #4120Re: TurboC++ link question...
From: Dave Kirsch
Date: Tue, 01 Jan 1991 23:20
Date: Tue, 01 Jan 1991 23:20
51 lines
2536 bytes
2536 bytes
> wallis@labc.enet.dec.com writes:
>
> Msg-ID: <18616@shlump.nac.dec.com>
> Posted: 2 Jan 91 15:34:05 GMT
>
> Org. : Digital Equipment Corporation
> Person: Barry L. Wallis
>
>
> In article <1990Dec26.205710.24627@cunixf.cc.columbia.edu>,
> rk29@cunixb.cc.columbia.edu (Robert Kulagowski) writes...
> >
> > Briefly, my question is this:
> > In Programmer's Journal Magazine there's been a series of articles
> >for upping graphics function speeds by writing them in assembler. I've
> >tried to link them in, but have had _no_ luck at all. The linker is giving
> me
> >an "unknown symbol" error in the modules which reference the assembler
> >routines. Now, I've already used MASM to compile the assembler source into
> >..OBJ; in the Project menu I have the 3 source files which make up the
> program.
> >Two are C, one is the .OBJ file. Can someone give me a walkthrough of
> getting
> >the linker in the IDE to include the .OBJ file? Needless to say, the manuals
> >weren't very helpful...
>
> 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);
Also, cdecl declared functions will have a leading underscore (_) placed on
them. What that means is when you link, it will be looking for "_line", not
just "line". You have to declare the assembler function as "_line proc" not
"line proc". Unless you are using the simple segment directives with the C
model option (i.e. "model large, c").
--
--
/// Dave 'Zoid' Kirsch UUCP: {uunet,ubc-cs}!van-bc!rsoft!mindlink!a563
Voice: (604) 585-8844 a563@mindlink.UUCP
Zoid@cc.sfu.ca
Vancouver, British Columbia
"In-no-sense? Nonsense!" - The Art Of Noise.
Technical Details
Message-ID:
<4296@mindlink.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!mips!sdd.hp.com!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a563Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!mips!sdd.hp.com!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a563 From: a563@mindlink.UUCP (Dave Kirsch) Newsgroups: comp.os.msdos.programmer Subject: Re: TurboC++ link question... Message-ID: <4296@mindlink.UUCP> Date: 1 Jan 91 23:20:47 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 51