[OFFTOPIC...but not really] DLLs and MinGW32
- Posted by Mike Hurley <mikehurley.1 at worldnet.att.net> May 20, 2001
- 398 views
This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C0E182.C62FE6C0 charset="iso-8859-1" How does one go about making DLLs with MinGW32? I've tried reading docs = online but none have been all too clear. I've played with dlltool and = dllwrap, but I haven't gotten one (DLL) that'll work with Eu's open_dll. = Could someone tell me the steps I'd need to take assuming MinGW32 (GCC = 2.95.2)? Thanks in advance. WARNING: C code to follow. WITH THESE FILES: MYDLL.C Source File DLLINIT.C DLL Initialization (DllMain) ** What should I code for = this? LIBMYDLL.A Library to be made so I can access my DLL from C (not have = to use LoadLibrary()) MYDLL.DLL Outputted DLL file that can be called from anything = supporting DLLs Instead of putzing with .DEFs, I put some kind of "export" command in = front of my routines. Ex. Want to export "TheAnswerIsThree" _export int TheAnswerIsThree() //pointless, I know { return 3; } I am basing the _export off what I saw in the included API files. What = should I use for that? I'd like what I could do step by step at probably a DOS command prompt. --Mike ------=_NextPart_000_0015_01C0E182.C62FE6C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>How does one go about making DLLs with=20 MinGW32? I've tried reading docs online but none have been all too = clear. I've played with dlltool and dllwrap, but I haven't gotten = one=20 (DLL) that'll work with Eu's open_dll. Could someone tell me the = steps I'd=20 need to take assuming MinGW32 (GCC 2.95.2)? Thanks in=20 advance.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>WARNING: C code to follow.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>WITH THESE FILES:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>MYDLL.C = Source=20 File</FONT></DIV> <DIV><FONT face=3DArial size=3D2>DLLINIT.C = DLL=20 Initialization (DllMain) ** What should I code for this?</FONT></DIV> <DIV><FONT face=3DArial size=3D2>LIBMYDLL.A Library to = be made so=20 I can access my DLL from C (not have to use LoadLibrary())</FONT></DIV> <DIV><FONT face=3DArial size=3D2>MYDLL.DLL Outputted = DLL file that=20 can be called from anything supporting DLLs</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Instead of putzing with .DEFs, I put = some kind of=20 "export" command in front of my routines.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Ex. Want to export = "TheAnswerIsThree"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>_export int = TheAnswerIsThree() =20 //pointless, I know</FONT></DIV> <DIV><FONT face=3DArial size=3D2>{</FONT></DIV> <DIV><FONT face=3DArial size=3D2> return = 3;</FONT></DIV> <DIV><FONT face=3DArial size=3D2>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I am basing the _export off what I saw = in the=20 included API files. What should I use for that?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I'd like what I could do step by = step at=20 probably a DOS command prompt.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> ------=_NextPart_000_0015_01C0E182.C62FE6C0--