Visual D 0.48-beta1

Rainer Schuetze r.sagitario at gmx.de
Wed Dec 12 21:36:49 UTC 2018



On 12/12/2018 11:25, Markus Pursche wrote:
> Hi Rainer, I wasn't sure exactly where to ask this, but I figured this
> is was as good of a place as any.
> 
> The new C++/D Project template looks absolutely amazing, it has never
> been this easy to get started with a C++ main function that can call D,
> especially on Windows. I was wondering how exactly this works in the
> background though, are you compiling to .obj files with the different
> compilers (MSVC+DMD) and then passing it to the linker, or are you
> creating a D static library and linking it that way behind the scenes?

Visual D adds a new task "CompileD" to msbuild together with a new "Item
Type" that gets automatically assigned to items with extension .d. This
task creates object files that are added to the linker command line in
addition to some additional options like library search paths.

> 
> I looked at the .vcxproj file and it looks very similar to "regular"
> .vcxproj files, could I edit my already existing C++ project (that uses
> a non-standard project template with a custom compiler, not MSVC) and
> just add the D parts and convert a C++ project to C++/D that way?
> 

You can just drag a .d file into any VC project to integrate it with
compilation and linkage. The D compiler options page will appear
automatically. (Depending on what your code does you might have to add
the phobos library to the linker settings, but it is supposed to be
automatic, too).

> This might just be the last step needed to get more game developers to
> follow Remedy and start using D in their engines (alongside C++ at
> first), assuming that it actually is that easy to do with any kind of
> C++ project.
> 
> I'll stick around the #d IRC channel if you have any specific questions
> about what it is I want to do, but I'm not sure how much I should say here.


More information about the Digitalmars-d-ide mailing list