bflattened / bflat

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)
GNU Affero General Public License v3.0
3.56k stars 102 forks source link

How to use the native DLL compiled by bflat with C++? #100

Closed 2dpdlja496or43iq closed 1 year ago

2dpdlja496or43iq commented 1 year ago

For example, I have this simple DLL that was built with bflat build SampleLibrary.cs:

using System;  
using System.Collections.Generic;  
using System.Text;  
namespace SampleLibrary  
{  
    public class Algebra  
    {  
        public double Addition(double x, double y)  
        {  
            return x + y;  
        }  
        public double Subtraction(double x, double y)  
        {  
            return x - y;  
        }  
        public double Multiplication(double x, double y)  
        {  
            return x * y;  
        }  
        public double Division(double x, double y)  
        {  
            return x / y;  
        }  
    }  
}

I want to use the native compiled SimpleLibrary.dll with C++.

MichalStrehovsky commented 1 year ago

Have a look at the DynamicLibrary sample: https://github.com/bflattened/bflat/tree/master/samples/DynamicLibrary