Status of Win32 C++ interop

Szymon Gatner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 4 08:43:43 PDT 2015


On Friday, 4 September 2015 at 14:18:40 UTC, Benjamin Thaut wrote:
> 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.

Hmm that is very good to hear, as is promising. In the mean time 
I tired making tiny Win x64 C++/D app as described by A.Ruppe in 
his book (I did that also when it was released and stdio was 
crashing apps) but now using phobos64.lib from 2.068 distribution 
does not even link properly with VC2015. Oh well, not just yet I 
suppose.

Thanks for your assistance!



More information about the Digitalmars-d-learn mailing list