www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/22/15:00:37

Message-ID: <362F8DE1.44FE7BC@clover.c2d.fedex.com>
Date: Thu, 22 Oct 1998 14:56:17 -0500
From: Walter Moore <walter AT clover DOT c2d DOT fedex DOT com>
Organization: Federal Express
X-Sender: "Walter Moore" <walter AT clover DOT c2d DOT fedex DOT com> (Unverified)
X-Mailer: Mozilla 4.04 [en]C-FedExIntl (Win95; I)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: RSXNTDJ compile error
References: <Pine DOT OSF DOT 4 DOT 05 DOT 9810221835300 DOT 8602-100000 AT sable DOT ox DOT ac DOT uk>
Reply-To: djgpp AT delorie DOT com

George Foot wrote:
> On Thu, 22 Oct 1998, Eli Zaretskii wrote:
> > On Wed, 21 Oct 1998, Walter Moore wrote:
> > > > d:/djgpp/contrib/rsxntdj/lib/dll0w32.o(.data+0x28):fake: undefined reference to
> > > > `_os2dll'
> > Not only `getopt': you also lack `_os2dll' and `environ' (the latter
> > is an array of pointers to environment variables accessed by 
> > `getenv' and `putenv').
> 
> I'm fairly sure that it's normal for `_os2dll' to be undefined
> -- perhaps only when you're load-time linking to a DLL.  I
> believe this is solved (not just covered up) by using RSXNTDJ's
> linker.  Take this with a pinch of salt though.

From my tests, you are correct. When I use the ld.exe that
came with RSXNTDJ, the DLL examples that came with rsxntdj will link,
and runtime.exe even runs correctly (I have no idea why loadtime.exe
dies). When I do not use the rsxntdj linker, then I get the _os2dll
as undefined. 

Also, I found that I had to use the following #defines to get 
the system to recognize getopt() optarg, and optind:

#ifdef __DJGPP__
#define getopt _getopt
#define optarg _optarg
#define optind _optind
#endif /* DJGPP */

Also, I re-wrote my subroutine that used the extern char *environ[]
as that way it was kept forcing gcc to try to compile in winmain(),
which I did not want, so I passed it the variable from the main(),
instead of just accessing it as a global variable.

Question: to use the winsock.dll, do I have to use LoadLibrary()
and GetProcAddress() for the socket? What I have done so far is:
   makelib /windows/system/wsock32.dll -o wsock32.a
   mv wsock32.a libwsock32.a

then I link with it:
gcc -O -Zwin32  -DCLIENT -o lpcli lpcli.o strcli.o autogen.o env.o
error.o initvars.o net.o options.o output.o readline.o writen.o
-Ic:/djgpp/src/loadplan/LPserver.works -lwsock32

It links ok, but when I run it, it acts like its connecting, but
when I try to write to the socket, it dies with a pop-up
window titles RSXNT with this error:
Exception at 0x004073CE
Application got signal SIGSEGV

note that the exception address will not change as long as I do
not make changes to and recompile the program.

-- 
Walter Moore                Sr. Programmer Analyst
Federal Express             wbmoore AT fedex DOT com
2813 Business Park          Memphis TN 38118 USA
work: 901-369-2640          fax: 901-369-3634

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019