Linking with/Debugging static C/C++ libraries

Dmitry Olshansky dmitry.olsh at gmail.com
Mon May 30 07:57:13 PDT 2011


On 30.05.2011 16:57, Trass3r wrote:
> Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter <MrMustard at gmail.com>:
>> One of the things that's important to us is being able to link against
>> some existing C/C++ static libraries (built with VS 2008, so PE COFF
>> format).
>
> Good luck with that. DLLs are no problem but static libraries are 
> another story.
> objconv has never done the job for me. I'm surprised that it worked in 
> your test.
> And compiling the code with dmc is a real PITA.
>
> Maybe dmd will finally switch to COFF output in the course of 64Bit 
> transition but even then the 2 different compilers might generate 
> incompatible code.
>
> There is a linker named Unilink though, which is reportedly able to 
> link OMF and COFF files out of the box.
> But it doesn't even have a homepage, only an ftp server that's hard to 
> find. Plus it's closed source so you can't assess whether it will 
> continue to be developed, if it becomes commercial one day etc.
>

It was me who brought it Unilink out of infernal abyss :)  See also:
http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html

Seriously I still suggest to try it out, and at any rate author showed 
quite a motivation and provided full D support in no time.
(there is little problem that he won't use CV debug symbols... and 
UniLink _converts_ them to Borland's TDS format)
Still it's now possible to use any linker with VisualD, using 'compile 
only' option (in fact I just tried it out myself).

>
>> For what it's worth, using GDC and GCC/MingW (TDM), I was able to build
>> and debug a D/C/C++ mixed executable. I had to use GDB (though WinGDB
>> works just dandy), but the downside is I'm not using Visual D (unless
>> Visual D supports GDC??), nor DMD. DMD seems that it would be more
>> supported and stable right now than GDC, which seems to play catch up. I
>> worry that, as a user of GDC, hitting a compiler bug, would take longer
>> to get an official fix for, than it would for DMD.
>
> GDC shares the frontend with dmd, so it will benefit from any FE bug 
> fixed there.
> Regarding the glue code, it is currently maintained by Iain alone. He 
> tends to be quite active though.
>

Right and I've seen this cool option 'use other compiler' in recent 
VisualD with textbox for command line. So GDC & LDC support is almost there.

>
> OT: You are R&D and still use Windoze? ;)


-- 
Dmitry Olshansky



More information about the Digitalmars-d-learn mailing list