digitalmars.D - How do you use C based libs with D?
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (10/10) Jun 11 2010 Hi, this is a bit related to my post regarding MingW compatibility.
- Adam Ruppe (4/4) Jun 11 2010 It works without much hassle at all if you dynamically link the
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (8/10) Jun 11 2010 Hi, yes, that's the fallback. Either getting all this stuff as DLL
- Nick Sabalausky (5/12) Jun 11 2010 You could just bundle the correct DLL directly in with your exe, in the ...
- Bane (3/18) Jun 11 2010 I deal the way you say: some compiles nice, some requires (lot) of work,...
- Alex Makhotin (13/24) Jun 11 2010 Produce static libraries in mingw as usual(no need to recompile with DMC...
Hi, this is a bit related to my post regarding MingW compatibility. As D uses Optilink (AFAIU) this implies that all C based code needs to be compiled with DMC? Not that I don't like DMC (I like it a lot) but I always had problems (or it requires a bunch of work) to get open-source projects compileable with it. How do you deal with this? -- Robert M. Münch http://www.robertmuench.de
Jun 11 2010
It works without much hassle at all if you dynamically link the library. That's what I do when using other people's C libs. (For my own, I'll just recompile with dmc on Windows. On Linux, it just works, since they all use the same linker anyway.)
Jun 11 2010
On 2010-06-11 21:39:19 +0200, Adam Ruppe said:It works without much hassle at all if you dynamically link the library. That's what I do when using other people's C libs.Hi, yes, that's the fallback. Either getting all this stuff as DLL already or having to make one. On the other hand I try to avoid "DLL hell" to keep the support costs as low as possible. -- Robert M. Münch http://www.robertmuench.de
Jun 11 2010
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message news:huu417$1pu9$1 digitalmars.com...On 2010-06-11 21:39:19 +0200, Adam Ruppe said:You could just bundle the correct DLL directly in with your exe, in the same directory. (Or convince the OSS devs to support DMC ;) )It works without much hassle at all if you dynamically link the library. That's what I do when using other people's C libs.Hi, yes, that's the fallback. Either getting all this stuff as DLL already or having to make one. On the other hand I try to avoid "DLL hell" to keep the support costs as low as possible.
Jun 11 2010
Robert M. Münch Wrote:Hi, this is a bit related to my post regarding MingW compatibility. As D uses Optilink (AFAIU) this implies that all C based code needs to be compiled with DMC? Not that I don't like DMC (I like it a lot) but I always had problems (or it requires a bunch of work) to get open-source projects compileable with it. How do you deal with this?I deal the way you say: some compiles nice, some requires (lot) of work, and some are just impossible to compile, so I use dll. Is there particular reason you avoid using dll's?-- Robert M. Münch http://www.robertmuench.de
Jun 11 2010
Robert M. Münch wrote:Hi, this is a bit related to my post regarding MingW compatibility. As D uses Optilink (AFAIU) this implies that all C based code needs to be compiled with DMC? Not that I don't like DMC (I like it a lot) but I always had problems (or it requires a bunch of work) to get open-source projects compileable with it. How do you deal with this?Produce static libraries in mingw as usual(no need to recompile with DMC or other compiler). Produce shared library from these static libraries with mingw by linking all of them in one DLL. Apply implib tool on obtained DLL. Link obtained import library with the target. Place the DLL in the exact private folder where your executable resides to avoid DLL hell. -- Alex Makhotin, the founder of BITPROX, http://bitprox.com
Jun 11 2010