Jump to page: 1 2
Thread overview
Status of Win32 C++ interop
Sep 04, 2015
Szymon Gatner
Sep 04, 2015
Benjamin Thaut
Sep 04, 2015
Szymon Gatner
Sep 04, 2015
Benjamin Thaut
Sep 04, 2015
Szymon Gatner
Sep 04, 2015
Kagamin
Sep 04, 2015
Benjamin Thaut
Sep 04, 2015
Szymon Gatner
Sep 04, 2015
Kagamin
Sep 04, 2015
Szymon Gatner
Sep 04, 2015
Laeeth Isharc
Sep 07, 2015
Benjamin Thaut
Sep 07, 2015
drug
Sep 08, 2015
Benjamin Thaut
Sep 08, 2015
drug
Sep 08, 2015
Laeeth Isharc
Sep 08, 2015
Kagamin
Sep 10, 2015
Benjamin Thaut
September 04, 2015
Hi,

what is the current status of:

- Win x86/32bit/coff32 interop with C++?

- improvements for general C++ interop that were suppose to come with 2.068
September 04, 2015
On Friday, 4 September 2015 at 08:53:27 UTC, Szymon Gatner wrote:
> Hi,
>
> what is the current status of:
>
> - Win x86/32bit/coff32 interop with C++?
>
> - improvements for general C++ interop that were suppose to come with 2.068

If you use either the -m64 or -mscoff32 interop should be pretty good. I'm currently using it heavily and its working quite nicely.
September 04, 2015
On Friday, 4 September 2015 at 08:58:41 UTC, Benjamin Thaut wrote:
> On Friday, 4 September 2015 at 08:53:27 UTC, Szymon Gatner wrote:
>> Hi,
>>
>> what is the current status of:
>>
>> - Win x86/32bit/coff32 interop with C++?
>>
>> - improvements for general C++ interop that were suppose to come with 2.068
>
> If you use either the -m64 or -mscoff32 interop should be pretty good. I'm currently using it heavily and its working quite nicely.

What about 32bit phobos? Last time I checked (2.067) only x64 was distributed.
September 04, 2015
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
September 04, 2015
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.
September 04, 2015
See https://issues.dlang.org/show_bug.cgi?id=13889
September 04, 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.
September 04, 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!

September 04, 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.

Hi Benjamin

Would you be able to give a little more colour on what the limits are of interoperability for C++ with DMD master or release ?  As I understand it destructors and constructors don't work, and obviously it will get tricky passing structures and classes from C++ libraries not ported to D.

Reason I ask is I am about to make a case to someone as to why we should use D, and I don't want to make any unfounded claims.  I don't really know C++ myself, although my noddy test worked fine.

Thanks - and we should bring the doc page IP to date.  At least say that more works than currently described, as I am sure this will be a factor in adoption.


Laeeth.

September 04, 2015
On Friday, 4 September 2015 at 15:43:44 UTC, Szymon Gatner wrote:
> but now using phobos64.lib from 2.068 distribution does not even link properly with VC2015.

That's https://issues.dlang.org/show_bug.cgi?id=14849
« First   ‹ Prev
1 2