<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Binaries are provided for OSX, but when I try to compile it (using a
    Makefile placed in dmd2/ shown below), I get linking errors due to <tt>libphobos2.a</tt>
    whenever I try to link even a basic D program. The program however
    links correctly if I replace my <tt>libphobos2.a</tt> with the
    supplied <tt>osx/lib/libphobos2.a</tt>.<br>
    <br>
    <b>Linking errors:</b><br>
    <br>
    <tt>$ dmd test.d<br>
      Undefined symbols:<br>
        "_D3std9exception14ErrnoException7__ClassZ", referenced from:<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      test.o<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_59a_102f.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_58e_c6a.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_58b_1029.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_599_c6c.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_597_c6a.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_590_c6f.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_588_102b.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_592_c6c.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_594_c75.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_58d_c6d.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_5a0_c71.o)<br>
            _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr in
      libphobos2.a(exception_4d3_d4e.o)<br>
           (maybe you meant:
      _D3std9exception14ErrnoException7__ClassZ$non_lazy_ptr)<br>
        "_D3std8datetime12__ModuleInfoZ", referenced from:<br>
            _D3std4file12__ModuleInfoZ in libphobos2.a(file.o)<br>
            _D3std6random12__ModuleInfoZ in libphobos2.a(random.o)<br>
        "_D3std9exception12__ModuleInfoZ", referenced from:<br>
            _D3std5stdio12__ModuleInfoZ in libphobos2.a(stdio.o)<br>
            _D3std5array12__ModuleInfoZ in libphobos2.a(array.o)<br>
            _D3std4conv12__ModuleInfoZ in libphobos2.a(conv.o)<br>
            _D3std6format12__ModuleInfoZ in libphobos2.a(format.o)<br>
            _D3std6string12__ModuleInfoZ in libphobos2.a(string.o)<br>
            _D3std5range12__ModuleInfoZ in libphobos2.a(range.o)<br>
            _D3std9algorithm12__ModuleInfoZ in libphobos2.a(algorithm.o)<br>
            _D3std3utf12__ModuleInfoZ in libphobos2.a(utf.o)<br>
            _D3std4file12__ModuleInfoZ in libphobos2.a(file.o)<br>
            _D3std8typecons12__ModuleInfoZ in libphobos2.a(typecons.o)<br>
            _D3std10functional12__ModuleInfoZ in
      libphobos2.a(functional.o)<br>
            _D3std6random12__ModuleInfoZ in libphobos2.a(random.o)<br>
            _D3std9container12__ModuleInfoZ in libphobos2.a(container.o)<br>
            _D3std7process12__ModuleInfoZ in libphobos2.a(process.o)<br>
            _D3std7numeric12__ModuleInfoZ in libphobos2.a(numeric.o)<br>
        "_D3std9exception7bailOutFAyaixAaZv", referenced from:<br>
           
      _D3std9exception173__T7enforceTbVAyaa73_2f55736572732f64616e73616e64756c6561632f4b6974732f444d442f646d64322f6275696c642f62696e2f2e2e2f2e2e2f7372632f70686f626f732f7374642f666f726d61742e64Vi668Z7enforceFbLAxaZb
      in test.o<br>
           
      _D3std9exception173__T7enforceTbVAyaa73_2f55736572732f64616e73616e64756c6561632f4b6974732f444d442f646d64322f6275696c642f62696e2f2e2e2f2e2e2f7372632f70686f626f732f7374642f666f726d61742e64Vi802Z7enforceFbLAxaZb
      in test.o<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi886Z7enforceFbLAxaZb
      in libphobos2.a(exception_59c_a71.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi629Z7enforceFbLAxaZb
      in libphobos2.a(exception_596_a6c.o)<br>
           
      _D3std9exception74__T7enforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374642f737464696f2e64Vi446Z7enforceFPOS4core4stdc5stdio6_iobufLAxaZPOS4core4stdc5stdio6_iobuf
      in libphobos2.a(exception_58f_e23.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi587Z7enforceFbLAxaZb
      in libphobos2.a(exception_593_a6f.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f737464696f2e64Vi1113Z7enforceFbLAxaZb
      in libphobos2.a(exception_5a1_a91.o)<br>
           
      _D3std9exception75__T7enforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374642f737464696f2e64Vi1129Z7enforceFPOS4core4stdc5stdio6_iobufLAxaZPOS4core4stdc5stdio6_iobuf
      in libphobos2.a(exception_5a2_e52.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f737464696f2e64Vi1045Z7enforceFbLAxaZb
      in libphobos2.a(exception_59d_a95.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi356Z7enforceFbLAxaZb
      in libphobos2.a(exception_58c_a69.o)<br>
           
      _D3std9exception44__T7enforceTbVAyaa9_7374642f7574662e64Vi313Z7enforceFbLAxaZb
      in libphobos2.a(exception_71e_98e.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi618Z7enforceFbLAxaZb
      in libphobos2.a(exception_595_a6a.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi871Z7enforceFbLAxaZb
      in libphobos2.a(exception_59b_a6b.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi542Z7enforceFbLAxaZb
      in libphobos2.a(exception_591_a66.o)<br>
           
      _D3std9exception49__T7enforceTbVAyaa11_7374642f737464696f2e64Vi640Z7enforceFbLAxaZb
      in libphobos2.a(exception_598_a65.o)<br>
           
      _D3std9exception49__T7enforceTkVAyaa11_7374642f737464696f2e64Vi459Z7enforceFkLAxaZk
      in libphobos2.a(exception_59f_a81.o)<br>
           
      _D3std9exception53__T7enforceTbVAyaa13_7374642f70726f636573732e64Vi544Z7enforceFbLAxaZb
      in libphobos2.a(exception_4d1_b44.o)<br>
           
      _D3std9exception53__T7enforceTbVAyaa13_7374642f70726f636573732e64Vi564Z7enforceFbLAxaZb
      in libphobos2.a(exception_4d2_b46.o)<br>
           
      _D3std9exception54__T7enforceTbVAyaa13_7374642f6e756d657269632e64Vi2268Z7enforceFbLAxaZb
      in libphobos2.a(exception_493_b6d.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f72616e67652e64Vi3083Z7enforceFbLAxaZb
      in libphobos2.a(exception_52e_a83.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f72616e67652e64Vi3114Z7enforceFbLAxaZb
      in libphobos2.a(exception_52f_a7e.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f72616e67652e64Vi2911Z7enforceFbLAxaZb
      in libphobos2.a(exception_52b_a82.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f61727261792e64Vi1660Z7enforceFbLAxaZb
      in libphobos2.a(exception_76_a94.o)<br>
           
      _D3std9exception50__T7enforceTbVAyaa11_7374642f61727261792e64Vi1664Z7enforceFbLAxaZb
      in libphobos2.a(exception_77_a98.o)<br>
           
      _D3std9exception52__T7enforceTbVAyaa12_7374642f666f726d61742e64Vi1140Z7enforceFbLAxaZb
      in libphobos2.a(exception_3a6_af7.o)<br>
       
      "_D3std9exception14ErrnoException6__ctorMFAyaAyakZC3std9exception14ErrnoException",
      referenced from:<br>
           
      _D3std9exception178__T12errnoEnforceTiVAyaa72_2f55736572732f64616e73616e64756c6561632f4b6974732f444d442f646d64322f6275696c642f62696e2f2e2e2f2e2e2f7372632f70686f626f732f7374642f737464696f2e64Vi1147Z12errnoEnforceFiLAyaZi
      in test.o<br>
           
      _D3std9exception80__T12errnoEnforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374642f737464696f2e64Vi848Z12errnoEnforceFPOS4core4stdc5stdio6_iobufLAyaZPOS4core4stdc5stdio6_iobuf
      in libphobos2.a(exception_59a_102f.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi423Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_58e_c6a.o)<br>
           
      _D3std9exception80__T12errnoEnforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374642f737464696f2e64Vi338Z12errnoEnforceFPOS4core4stdc5stdio6_iobufLAyaZPOS4core4stdc5stdio6_iobuf
      in libphobos2.a(exception_58b_1029.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi641Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_599_c6c.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi630Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_597_c6a.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi446Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_590_c6f.o)<br>
           
      _D3std9exception80__T12errnoEnforceTPOS4core4stdc5stdio6_iobufVAyaa11_7374642f737464696f2e64Vi286Z12errnoEnforceFPOS4core4stdc5stdio6_iobufLAyaZPOS4core4stdc5stdio6_iobuf
      in libphobos2.a(exception_588_102b.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi551Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_592_c6c.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi596Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_594_c75.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi417Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_58d_c6d.o)<br>
           
      _D3std9exception55__T12errnoEnforceTbVAyaa11_7374642f737464696f2e64Vi475Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_5a0_c71.o)<br>
           
      _D3std9exception59__T12errnoEnforceTbVAyaa13_7374642f70726f636573732e64Vi566Z12errnoEnforceFbLAyaZb
      in libphobos2.a(exception_4d3_d4e.o)<br>
      ld: symbol(s) not found<br>
      collect2: ld returned 1 exit status<br>
      --- errorlevel 1</tt><br>
    <br>
    <br>
    <br>
    <b>Makefile:</b><br>
    <br>
    <tt>BUILDDIR := build<br>
      <br>
      SRCDIR := src<br>
      TARGETS := dmd druntime phobos<br>
      CONF := osx/bin/dmd.conf<br>
      <br>
      <br>
      all: $(TARGETS)<br>
      <br>
      .PHONY: dmd druntime phobos<br>
      <br>
      dmd:      $(BUILDDIR)/bin/dmd<br>
      druntime:    $(BUILDDIR)/lib/libdruntime.a<br>
      phobos:   $(BUILDDIR)/lib/libphobos2.a<br>
      <br>
      $(BUILDDIR)/bin/dmd:<br>
              mkdir -p $(dir $@)<br>
              make -C$(SRCDIR)/dmd -f osx.mak<br>
              cp $(SRCDIR)/dmd/dmd $@<br>
              cp $(CONF) $(BUILDDIR)/bin/dmd.conf<br>
      <br>
      $(BUILDDIR)/lib/libdruntime.a:<br>
              mkdir -p $(dir $@)<br>
              make -C$(SRCDIR)/druntime -f posix.mak<br>
              cp $(SRCDIR)/druntime/lib/libdruntime.a $@<br>
      <br>
      <br>
      $(BUILDDIR)/lib/libphobos2.a:<br>
              mkdir -p $(dir $@)<br>
              make -C$(SRCDIR)/phobos -f osx.mak<br>
              cp $(SRCDIR)/phobos/generated/posix/release/libphobos2.a
      $@<br>
      <br>
    </tt><br>
  </body>
</html>