Status of Win32 C++ interop

Benjamin Thaut via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 4 07:18:39 PDT 2015


On Friday, 4 September 2015 at 10:04:48 UTC, Szymon Gatner wrote:
> On Friday, 4 September 2015 at 09:27:14 UTC, Benjamin Thaut 
> wrote:
>> On Friday, 4 September 2015 at 09:07:39 UTC, Szymon Gatner 
>> wrote:
>>>
>>> What about 32bit phobos? Last time I checked (2.067) only x64 
>>> was distributed.
>>
>> You have to compile it yourself. Use the win64 makefile and 
>> replace the arch=64 with
>> arch=32mscoff.
>>
>> For more details see here:
>> http://www.digitalmars.com/d/archives/digitalmars/D/learn/How_to_get_32mscoff_libraries_for_phobos_73980.html
>
> Ah so that didn't change. Did you try it? Do you run hybrid 
> C++/D apps on Win (whether 32 or 64)?. Asking because last time 
> I tried it (Win x64 tho) writeln() call from D side crashed app 
> because stdio wasn't properly initialized even tho rt_init() 
> was successful.

I am running hybrid D/C++ apps. I found it to work best when you 
give D the control over the main method, e.g. the program entry 
point should be in D land. Then simply call a C++ function from 
there to initialize your c++ stuff.

I'm currently even running hybrid C++/D apps with dlls. E.g. 
multiple D dlls + multiple C++ dlls loaded by a c++ main program. 
But to do that I have heavy compiler + runtime modifications 
which are not ready yet to do a PR for them.


More information about the Digitalmars-d-learn mailing list