<div class="gmail_quote">On 6 January 2012 21:06, Nick Sabalausky <span dir="ltr"><a@a.a></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Yea, OMF is actually #1 PITA on Windows right now, unfortunately.</div>
<br>
The problem: On windows, DMD uses the Optlink linker. Optlink only supports<br>
OMF right now (OMF used to be commonly used by Borland, IIRC). Optlink was<br>
written entirely in asm so changing it is difficult. But Walter has been,<br>
piece-by-piece, porting it to C (and then he'll port it to D). (This is<br>
issue also happens to be the main thing blocking 64-bit on Windows.)<br></blockquote><div><br></div><div>Lame. Surely Optlink is not the only linker in the world...?</div><div>I'm also surprised that someone capable of writing a compiler and optimiser for a complex language isn't capable of writing a linker. The link must surely be the simplest+easiest of those 3 jobs...?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are a few solutions right now (in no particular order):<br>
<br>
- Recompile the libs using DMC (the Digital Mars C/C++ compiler). That will<br>
result in an OMF lib file that can be used with DMD.<br></blockquote><div><br></div><div>DMx has inferior code generation, not a chance :) .. And does DMC even support all the features of the language? SSE? No support in D, why would it work in DMC?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">- Link with Unilink instead of DMD/Optlink. Unilink can link both OMF and<br>
COFF together just fine. I don't have a link offhand, and it's a little<br>
funky to learn how to use since the docs aren't very good, but I'm sure<br>
someone here will chime in (or you can search the archives, I know comeone<br>
posted a good introduction to it not too long ago).<br></blockquote><div><br></div><div>Why not use this instead of Optlink if it works?</div><div>I'll check it out... though VisualD doesn't support this.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">- Use the Digital Mars COFF2OMF tool to convert to lib to OMF.<br>
Unfortunately, the tool isn't free, but IIRC it's inexpensive.<br></blockquote><div><br></div><div>Seriously... I just simply won't bother, and write my app in C instead ;)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Use LDC or GDC instead of DMD. I think those work with COFF.<br></blockquote><div><br></div><div>VisualD doesn't support those compilers (yet).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- If the library comes in a DLL version, you can download the free IMPLIB<br>
tool and use it to generate an OMF import library directly from the DLL<br>
(it'll still actually link to the DLL at runtime).<br></blockquote><div><br></div><div>I could probably build my engine as a DLL... I've been planning to do this for a long time anyway.</div><div>Maybe this is the extra bit of motivation I need to do it ;)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The IMPLIB and COFF2OMF tools are here:<br>
<a href="http://www.digitalmars.com/download/freecompiler.html" target="_blank">http://www.digitalmars.com/download/freecompiler.html</a>  IMPLIB is in the free<br>
"Basic Utilities" package, and COFF2OMF is in the "Extended Utilities<br>
Package"<br>
<br>
If you feel this is all still a big pain in the ass: Don't worry, everyone<br>
here agrees with you, and the situation will not remain like this forever.<br></blockquote><div><br></div><div>Indeed. The main reason for my post is just to complain, and add my voice ;)</div><div>I'd like to insist that this is basically unacceptable... it should be prioritised.</div>
</div>