Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #1828

Re: C DLL

Subject Re: C DLL
Newsgroups comp.os.os2.programmer.misc
References (1 earlier) <uqojbs$1ac8$1@dont-email.me> <ngSzN.229273$yEgf.198939@fx09.iad> <uqp3b8$3qu6$1@dont-email.me> <667AN.338523$Wp_8.44562@fx17.iad> <uqr0d2$i8f2$1@dont-email.me>
From Dave Yeo <dave.r.yeo@gmail.com>
Message-ID <U9cAN.71155$24ld.37302@fx07.iad> (permalink)
Date 2024-02-17 16:27 -0800

Show all headers | View raw


Paul Edwards wrote:
> On 18/02/24 02:42, Dave Yeo wrote:
>
>>> With Microsoft gone by OS/2 2.0, it would have been
>>> IBM with CSET/2 that set any standard for a separate
>>> DLL for the C runtime.
>>
>> Well, the equivalent of mingw is libcn, rebranded kLIBC which was a BSD
>> rewrite of EMX GPL libc. Mostly used with GCC.
>> The IBM compilers came with some libraries, single threaded and
>> multi-threaded that I forget the name of and are usually statically
>> linked in.
>> Perhaps os2386.lib is what you are looking for?
>
> It depends whether os2386.lib has the function
> printf etc that are very small and just create
> a reference to something.dll to be resolved at
> runtime, or whether they cause a large amount
> of code to be linked in that gets resolved to
> a DosWrite in doscalls.dll.

Looking at a map file for an OW program using printf(), I see,
g:\WATCOM/lib386/os2\clib3s.lib
g:\WATCOM/lib386\math387s.lib
G:\OS2TK45\lib\os2386.lib

Note that I have the toolkit in the front of the set LIB statement as 
the toolkit is the official SDK. I assume with an OW program that it is 
clib3s.lib that has libc functions such as printf(). Really not sure 
about the IBM compilers. Most of my limited experience has been with GCC

>
> I am after the former, not the latter.
>
> But that does sound interesting. That single-threaded
> library that is *usually* statically linked in - does
> that mean it can be dynamically linked in if desired?

Single threaded libs are more for DOS programs.
I'm not sure which DLLs contain the libc functions if any. With GCC, it 
is libcXX.dll.

>
> If so, it resolves to what DLL, and does that DLL ship
> with OS/2 even if you don't have the IBM compiler?

Sometimes people forget statically link or include the DLL with programs 
that are compiled with IBM compiler, they don't run. So no.

>
>> At least in GCC land, there is crt0.o and similar to be statically
>> linked in.
>
> I don't mind that. I just need the entire C90
> library - printf, strtol, etc, to reside in an
> external DLL. It's normal to have a little bit
> of code statically linked in that will set things
> up to call routines in that external DLL.
>

I really don't know exactly how it works with the IBM compilers and 
libc. Hopefully someone else can chime in.

You should install the toolkit,
yum install os2tk45 os2tk45-books os2tk45-headers os2tk45-libs os2tk45-utils
and perhaps os2tk45-ipf os2tk45-rc.
Find it installed in %UNIXROOT%\usr\include\os2tk45, %UNIXROOT%\usr\lib\ 
and various other places in %UNIXROOT%\usr
and favour the toolkit libs over the OW ones.
Dave

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-17 04:35 +0800
  Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-17 05:16 +0800
    Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-16 15:32 -0800
      Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-17 09:49 +0800
        Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-17 10:42 -0800
          Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-18 03:11 +0800
            Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-17 16:27 -0800
              Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-18 09:56 +0800
                Re: C DLL xhajt03 <xhajt03@gmail.com> - 2024-02-18 07:33 -0800
                Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-19 10:41 +0800
                Re: C DLL xhajt03 <xhajt03@gmail.com> - 2024-02-19 03:47 -0800
                Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-19 20:17 +0800
                Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-19 14:31 -0800
                Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-20 06:47 +0800
                Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-19 22:03 -0800
                Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-20 14:16 +0800
  Re: C DLL Dave Yeo <dave.r.yeo@gmail.com> - 2024-02-16 15:28 -0800
  Re: C DLL Marcel Mueller <news.5.maazl@spamgourmet.org> - 2024-02-17 10:11 +0100
    Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-17 18:00 +0800
      Re: C DLL Paul Edwards <mutazilah@gmail.com> - 2024-02-17 18:03 +0800

csiph-web