Calypso: Direct and full interfacing to C++

Kelly via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Feb 11 11:13:58 PST 2015


On Monday, 9 February 2015 at 22:38:51 UTC, Elie Morisse wrote:
> On Monday, 9 February 2015 at 07:10:56 UTC, Suliman wrote:
>> If somebody have working Windows build, could you please share 
>> it?
>
> It would be nice to know if someone even managed to build 
> Calypso on Windows yet :)
>

Hello Elie,

I did manage to build Calypso on Win7, and the resulting binary 
works to produce an obj file, but linking of a full executable 
fails :(

I am getting "file contains invalid .pdata contributions" when 
trying to link. Trass3r over on ldc's github page was getting 
this error at one point also, but I don't know what the solution 
was. It seems like this was back in Aug 2014 so I would have 
thought any changes needed were picked up by Calypso when you 
forked in Oct.

I would post an issue with ldc but Calypso isn't up to date, so 
it might not be really fair as the fix may be in the newest ldc. 
I can't see anything standing out in the commits for an issue 
like this, but I might just be missing it.

Thanks,
Kelly



P.S. There is a small patch needed to compile on windows with 
VS2013. Things should still build fine on Linux with the patch. 
Here it is:

diff --git a/dmd2/cpp/cppimport.cpp b/dmd2/cpp/cppimport.cpp
index 709f324..2dec2ae 100644
--- a/dmd2/cpp/cppimport.cpp
+++ b/dmd2/cpp/cppimport.cpp
@@ -6,7 +6,10 @@
  #include "cpp/calypso.h"
  #include "expression.h"

+#ifndef _MSC_VER
  #include <unistd.h>
+#endif
+
  #include <stdlib.h>
  #include <stdio.h>

diff --git a/dmd2/cpp/cppmodule.cpp b/dmd2/cpp/cppmodule.cpp
index 114f3f0..385cb79 100644
--- a/dmd2/cpp/cppmodule.cpp
+++ b/dmd2/cpp/cppmodule.cpp
@@ -21,7 +21,10 @@
  #include "cppexpression.h"
  #include "cpptemplate.h"

+#ifndef _MSC_VER
  #include <unistd.h>
+#endif
+
  #include <stdio.h>
  #include <stdlib.h>

diff --git a/dmd2/mars.h b/dmd2/mars.h
index b22dc5b..fc8f798 100644
--- a/dmd2/mars.h
+++ b/dmd2/mars.h
@@ -270,8 +270,8 @@ struct Compiler
      const char *vendor;     // Compiler backend name
  };

-struct LangPlugin;
-typedef Array<struct LangPlugin *> LangPlugins;
+class LangPlugin;
+typedef Array<class LangPlugin *> LangPlugins;

  typedef unsigned structalign_t;
  #define STRUCTALIGN_DEFAULT ((structalign_t) ~0)



More information about the Digitalmars-d-announce mailing list