On Tuesday, 21 October 2014 at 09:38:55 UTC, Mike Parker wrote:
On 10/21/2014 3:41 PM, Edn wrote:

I'm trying to compile a simple program using D and GLFW. I heard that in
order to use Deimos GLFW you will have to compile
https://github.com/glfw/glfw using the digitalmars c++ compiler since
dmd only supports OMF?

On Windows, when compiling as 32-bit, the compiler makes use of the OPTLINK linker that ships with it. OPTLINK only supports OMF. So you can compile a C library with dmc (which also uses OPTLINK) or you can take a library in COFF format and run it through an object converter (like coff2omf or Agner Fog's Object Converter[1]) to convert it to OMF.

When compiling with DMD as 64-bit, the compiler makes use of the Visual Studio toolchain, so you can use 64-bit COFF libraries out of the box after you install the VS tools.

If you are linking with the import library instead of a static library, the same idea applies. But in that case you can run a tool like coffimplib on the DLL to create an import library in OMF format, then link with it.

Both coff2omf and coffimplib are available, along with other useful utilities, as part of the Digital Mars Extended Utility Package [2] which is available for sale at [3].

This problem does not exist on Linux or Mac as DMD uses the GCC backend for those platforms.

[1] http://www.agner.org/optimize/#objconv
[2] http://www.digitalmars.com/eup.html
[3] http://www.digitalmars.com/shop.html

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

So if I compile DMD as x64 I can then use the libraries for VC120 that comes with the glfw windows binaries ? http://www.glfw.org/download.html
and then compile using :
dmd -d main.d glfw3.lib

Reply via email to