| Thread overview | |||||
|---|---|---|---|---|---|
|
March 19, 2009 DMC to Create C .lib ? | ||||
|---|---|---|---|---|
| ||||
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? | ||||
March 19, 2009 Re: DMC to Create C .lib ? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Chris Andrews | 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!" | |||
March 19, 2009 Re: DMC to Create C .lib ? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Chris Andrews | 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
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply