Date: Thu, 22 Oct 1998 22:00:20 +0100 (BST) From: George Foot To: djgpp AT delorie DOT com Subject: Re: RSXNTDJ compile error In-Reply-To: <362F8DE1.44FE7BC@clover.c2d.fedex.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 22 Oct 1998, Walter Moore wrote: > 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). Hmm, maybe you should find out? It works fine for me. Note that just about all RSXNT programs use load time DLL linking IIRC -- all of the C library is in a DLL. I think unless you switch this off, your application will load RSXNT.DLL at load time. > 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. I have no idea what you're talking about; but I don't use getopt etc. > 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 That's pretty much what I've done (see my other email about this) but I didn't use the winsock.h that comes with RSXNTDJ. Everything works fine for me so far. > 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. Have you tried debugging it? See the RSXNTDJ docs for information on this. -- george DOT foot AT merton DOT oxford DOT ac DOT uk xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html