🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
2 messages
2 total messages Started by KASSARJIAN STEVEN J Mon, 25 Jan 1993 18:31
How to link C Set/2 library to GCC/2 or gcc-emx
#3631
Author: KASSARJIAN STEVEN J
Date: Mon, 25 Jan 1993 18:31
64 lines
4038 bytes
My data acquisition hardware comes with software libraries for use
with either IBM's CSet/2 or MS's C v6.0a.  Of course I have very
little money (and no CD-ROM player) so my compiler choices are limited
to GCC/2 and gcc-emx.

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?

Using gcc-emx 0.8f (and the linking option -Zomf) the linker can not
find OS2386.LIB, dde4sbs.lib, nor dde4sbm.lib.  The result is that a
number of functions are not resolved by the linker: _sprintfieee,
_printfieee, fileno, _DosSelToFlat, _DosFlatToSel.  I have
successfully compiled and linked all of the test programs, with and
without the -Zomf linking option.  I suspect that OS2386.LIB and the
other two libraries are Toolkit libraries.  Can some of the emx
libraries be substituted?  How?

Suggestions for getting the CSet/2 library to link with either GCC/2
or (preferably) gcc-emx will be gladly received.  If this is more
difficult than thunking my way to the MS C v6.0a library, I'd be happy
to receive relevant advice.  (I am aware of the section on thunking in
emxdev.doc, but have not read it carefully---yet.)

(As a last resort, I suppose it might be possible to "convert" the MS
C library into a DLL.  But this would require 1> I borrow a friend's
machine 2> I learn how to make and use my own DLLs, so I'd rather
avoid this.  However, this would be easier than locating someone with
a CD-ROM player, borrowing it, and waiting for the PDK to arrive.)

Best regards and thank you,
Steve Kassarjian
kassarji@spot.Colorado.edu

gcc-emx error message follows:

Operating System/2 Program Maintenance Utility
Version 2.000.000 Mar 27 1992
Copyright (C) IBM Corporation 1988-1991.
Copyright (C) Microsoft Corp. 1988-1991.
All rights reserved.

	gcc -Zomf -los2 display.c \dap\os2\c\ibmc\cdap32.lib generic.def

LINK386 : warning L4051: OS2386.LIB : cannot find library
LINK386 : warning L4051: dde4sbs.lib : cannot find library
LINK386 : warning L4051: dde4sbm.lib : cannot find library

\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CFGDAP.C) : error L2029: '_sprintfieee' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CFGDAP.C) : error L2029: '_printfieee' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIOCD.C) : error L2029: 'fileno' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIO.C) : error L2029: 'fileno' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CLOCK.C) : error L2029: '_DosSelToFlat' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIOCD.C) : error L2029: '_DosSelToFlat' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIO.C) : error L2029: '_DosSelToFlat' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CFGDAP.C) : error L2029: '_DosSelToFlat' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CLOCK.C) : error L2029: '_DosFlatToSel' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIOCD.C) : error L2029: '_DosFlatToSel' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\DAPIO.C) : error L2029: '_DosFlatToSel' : unresolved external
\dap\os2\c\ibmc\cdap32.lib(H:\ENG\CLIB\SRC\IBMC\CFGDAP.C) : error L2029: '_DosFlatToSel' : unresolved external


There were 5 errors detected
Re: How to link C Set/2 library to GCC/2 or gcc-emx
#3642
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads