digitalmars.D - DMC to Create C .lib ?
- Chris Andrews <CodexArcanum gmail.com> Mar 19 2009
- Sergey Gromov <snake.scaly gmail.com> Mar 19 2009
- Trass3r <mrmocool gmx.de> Mar 19 2009
I'm working on a wrapper to a C dll and I think that I'll need to create a .lib file eventually to connect my D code to the C library. I've experimented with this a little, including using ipmlib to create the lib, which creates a lib but not one that works right (I think it mangles the names wrong.) However, the excellent linkdef tool works to create a good .def which allows implib to create a proper lib. Still, that seems a fussy way to build this: write it wrong, break it, use linkdef and implib to fix it. I have the source code for that dll, so what I'm wondering is, can I just use some other DM tools (DMC?) to compile that C code and get a proper .lib from that?
Mar 19 2009
Thu, 19 Mar 2009 17:27:30 -0400, Chris Andrews wrote:I'm working on a wrapper to a C dll and I think that I'll need to create a .lib file eventually to connect my D code to the C library. I've experimented with this a little, including using ipmlib to create the lib, which creates a lib but not one that works right (I think it mangles the names wrong.) However, the excellent linkdef tool works to create a good .def which allows implib to create a proper lib. Still, that seems a fussy way to build this: write it wrong, break it, use linkdef and implib to fix it. I have the source code for that dll, so what I'm wondering is, can I just use some other DM tools (DMC?) to compile that C code and get a proper .lib from that?
Use coffimplib on your regular .lib file: http://www.digitalmars.com/ctg/coffimplib.html Get it at ftp.digitalmars.com. I'm advertising coffimplib so much that I probably need a badge already, "Want to create an import library? Ask me how!"
Mar 19 2009
Chris Andrews schrieb:Still, that seems a fussy way to build this: write it wrong, break it, use linkdef and implib to fix it. I have the source code for that dll, so what I'm wondering is, can I just use some other DM tools (DMC?) to compile that C code and get a proper .lib from that?
If you have source code, you can of course compile a static library. dmc -c *.c lib -c libname.lib *.obj
Mar 19 2009









Sergey Gromov <snake.scaly gmail.com> 