Newsgroups: comp.os.os2.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!clarkson!grape.ecs.clarkson.edu!towfiq From: towfiq@FTP.COM (Mark Towfiq) Subject: Re: Making a DLL... Reply-To: towfiq@FTP.COM Organization: FTP Software, Inc., Wakefield, MA Date: 17 Apr 91 11:11:59 Message-ID: In-Reply-To: slh@gibdo.engr.washington.edu's message of 17 Apr 91 11:08:27 GMT References: <1991Apr15.184434.14562@grasp1.univ-lyon1.fr> <1991Apr17.110518.13084@gibdo.engr.washington.edu> Sender: usenet@grape.ecs.clarkson.edu >>>>> On Mon, 15 Apr 1991 18:44:34 GMT, rol@grasp1.univ-lyon1.fr (Paul Rolland) said: Paul> I'm trying to make a DLL for an OS/2 multi tasking program. I've written Paul> my C program, compile it with the following options: Paul> cl -FPa -Alfu -DDLL -W3 -G2s -c prog.c So far, so good. Paul> Then I link it with the following command: Paul> link prog /noi,dll.dll,,crtlib.lib doscalls.lib /nod,dll.def; Paul> with dll.def containing: Paul> LIBRARY DLL Paul> DESCRIPTION 'my prog' Paul> EXPORTS Paul> _myproc (with or without @1) >>>>> On 17 Apr 91 11:08:27 GMT, slh@gibdo.engr.washington.edu said: slh> one thing I see is you need to link with the dll version of the slh> library (LLIBDLL.LIB, I think is the name) That's right, since he is building a DLL he needs to like either with LLIBCDLL, or, if his application and DLL have to share C run-time information, such as the variable errno, or file i/o streams, he must use the customized CRTLIB (this is what FTP did for our PC/TCP Developer's Toolkit). Paul> I then use it in another prog, but when I start it, I get the Paul> following message: Paul> SYS2070: Ths system could not demand load the Paul> application's segment. DLL _MYPROC is in error. Paul> For additional information also see message SYS0127. Paul> My questions are: Let's take them one at a time. Paul> What does this message mean? It means that the application is looking for a function called _MYPROC in the DLL module, but that it is not there. Paul> Where have I done an error? You have forgotten to link your application with /NOI, case insensitivity, so that the application is looking for _MYPROC, when you really want it to find _myproc. You should really also link with /NOD and /NOE, in my experience. Paul> And where can I found a description of these messages ????? Use the "helpmsg" command: "helpmsg sys0127" will give you more details. Hope this helps, Mark -- Mark Towfiq, FTP Software, Inc. towfiq@FTP.COM Work No.: +1 617 246 0900 Home No.: +1 617 488 2818 "The Earth is but One Country, and Mankind its Citizens" -- Baha'u'llah