Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > openwatcom.users.c_cpp > #3516

Re: Creating Dos/4gw Dynamic Link Libraries?

From Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Newsgroups openwatcom.users.c_cpp
Subject Re: Creating Dos/4gw Dynamic Link Libraries?
Date 2018-01-03 17:01 +0800
Organization OpenWatcom
Message-ID <p2i9jf$87r$1@www.openwatcom.org> (permalink)
References <p2den3$v58$1@www.openwatcom.org> <p2e8dq$51c$1@www.openwatcom.org> <p2eiv3$7ib$1@www.openwatcom.org> <p2g2ff$ick$1@www.openwatcom.org>

Show all headers | View raw


Frank Beythien wrote:

> I don't think so as neither the guides nor the wlink.lnk file with all
> system definitions for linking has an entry for Dos/4g dlls.
> Here:
> http://www.tenberry.com/dos4g/watcom/4gwtable.html
> it shows DLLs are only possible with the $999 price tag and not with
> the watcom included version 1.97.

Indeed.  I only discovered that *after* making a successful compile,
see below.

>>> It would help if you posted a minimal (compiling!) example with the
>>> complete wcc386 and wlink cmdlines output to see which version you
>>> are using.
>>
>> What do you mean?  The makefile I listed shows the explicit wlink
>> command.  I am using Open Watcom 1.9 (in DOSBox for this exercise).
>
> Why can't you provide the terminal output from running wcc386 ...
> and the full source code so it gets reproducable for anyone who wants
> to help?

Because my very first message included the full source code with repro-
ducible makefile.  You're asking for something that's already there.

As for terminal output, I have yet to see DOSBox allow me to copy and
paste text.  Yes, I'm running the compiler also in DOSBox.  I'm not on
OS/2, Windows or Linux.

Here is the rest (below) for a fully compiling but nonfunctional
example.

By adding the option undefok to the DLL link options, I managed to com-
pile the DLL, but when I try to run it, I get

   DOS/4GW error (2302): DLL modules not supported
   DOS/4GW error (2301): can't find foo.foo_ - referenced from BAR
   DOS/4GW fatal error (1313): can't resolve external references

So for the most part, Open Watcom does know how to make DOS/4GW DLLs,
but (of course) can't run them.  There's no way for me to tell what
exactly might fail during runtime since neither __DLLstart() nor main()
are defined.

I consider this exercise concluded.

// File: bar.c
#include <stdio.h>

#include "foo.h"

int main( int argc, char *argv[] )
{
   printf( "Hello, %s\n", foo() );

   return 0;
}

// End: bar.c

## File: Makefile

bar.exe: bar.obj foo.dll
	wlink system 386 name bar file bar import foo_ foo

bar.obj: bar.c
	wcc386 -6r bar.c

foo.dll: foo.obj
	wlink system 386 dll option map,undefsok  name foo file foo

foo.obj: foo.c
	wcc386 -bd -6r foo.c

## End: Makefile

-- 
Johann | email: invalid -> com | www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | twitter: @myrkraverk

Back to openwatcom.users.c_cpp | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Creating Dos/4gw Dynamic Link Libraries? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2018-01-01 20:57 +0800
  Re: Creating Dos/4gw Dynamic Link Libraries? Frank Beythien <fbeythien@gmx.de> - 2018-01-01 21:16 +0100
    Re: Creating Dos/4gw Dynamic Link Libraries? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2018-01-02 07:16 +0800
      Re: Creating Dos/4gw Dynamic Link Libraries? Frank Beythien <fbeythien@gmx.de> - 2018-01-02 13:47 +0100
        Re: Creating Dos/4gw Dynamic Link Libraries? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2018-01-03 17:01 +0800
      Re: Creating Dos/4gw Dynamic Link Libraries? Paul S. Person <psperson@ix.netscom.com.invalid> - 2018-01-02 09:53 -0800

csiph-web