Is it possible to create a library with ldc and port it to LLVM

Johan j at j.nl
Wed Sep 23 23:31:49 UTC 2020


On Wednesday, 23 September 2020 at 22:59:25 UTC, Ruby The 
Roobster wrote:
> Can you create a library(.lib) with ldc and port it to clang++?
> e.g.
>
> //test.d
> module test;
> import std.stdio;
> void hi()
> {
> writeln("hello");
> }
>
> //test.cpp(links to test.lib which contains test.hi
> #include <iostream>
> extern "D" void hi();
> void main() {
> hi();
> }
> //Hopefully prints "hi"

See
https://stackoverflow.com/questions/26923976/calling-a-d-function-directly-from-c


More information about the digitalmars-d-ldc mailing list