🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #3642

Re: How to link C Set/2 library to GCC/2 or gcc-emx

#3642
From: Colin Jensen
Date: Tue, 26 Jan 1993 01:28
22 lines
1517 bytes
In article <1993Jan25.183155.20860@ucsu.Colorado.EDU> kassarji@spot.Colorado.EDU (KASSARJIAN STEVEN J) writes:
>Using GCC/2 and link386 I get unresolved external functions (the ones
>in the library provided by the hardware vendor, but proceeded by a
>single _ character).  Apparently GCC/2 and CSet/2 mangle function
>names differently.  Can this be averted?  How?

Assuming you have a vendor supplied function 
	void foo(void);
you will need to declare foo() as
	void foo(void) asm("foo");
in order for gcc/2 to be happy with it.

This advice only applies if the library is 32bit though...

Basically, DLLs and LIBs usually have no pre-pended underscore for symbol
names.  Gcc/2 by default wants pre-pended underscore.  The asm notation
tells gcc/2 that the symbol should really be refered to by a different
name - in this example, I tell gcc that the symbol "foo" should translate
as the symbol "foo" rather than the default translation of "_foo".
-- 
Colin Jensen
ljensen@netcom.netcom.com	cjensen@ampex.com
Technical Details
Message-ID: <1993Jan26.012821.9348@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ames!pacbell.com!charon.amdahl.com!netcomsv!netcom.com!ljensen
References: <1993Jan25.183155.20860@ucsu.Colorado.EDU>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ames!pacbell.com!charon.amdahl.com!netcomsv!netcom.com!ljensen
From: ljensen@netcom.com (Colin Jensen)
Subject: Re: How to link C Set/2 library to GCC/2 or gcc-emx
Message-ID: <1993Jan26.012821.9348@netcom.com>
Organization: Netcom - Online Communication Services (408 241-9760 guest)
References: <1993Jan25.183155.20860@ucsu.Colorado.EDU>
Date: Tue, 26 Jan 1993 01:28:21 GMT
Lines: 22