From: kassarji@spot.Colorado.EDU (KASSARJIAN STEVEN J)
Subject: How to link C Set/2 library to GCC/2 or gcc-emx
Organization: University of Colorado, Boulder
Date: Mon, 25 Jan 1993 18:31:55 GMT

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