Message-ID: <362F8DE1.44FE7BC@clover.c2d.fedex.com> Date: Thu, 22 Oct 1998 14:56:17 -0500 From: Walter Moore Organization: Federal Express X-Sender: "Walter Moore" (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: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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