Embeddinator-4000 icon indicating copy to clipboard operation
Embeddinator-4000 copied to clipboard

Problem with dependent dll: Generation C# to C in Linux (Windows)

Open petrivanovivanovich80 opened this issue 7 years ago • 1 comments

I have two dll(Test.dll and TestStruct.dll). TestStruct.dll have Class "TestClass".

namespace TestStrcut
{
    public class TestClass
    {
        private int _id;

        public TestClass(int id)
        {
            this._id = id;
        }
    }
}

Test.dll depend of TestStruct.dll. Test.dll have two methods "Test2" and "Test1". Test1 return nothing. Test2 return instance of TestClass.

namespace Test
{
    public static class Tst
    {
        public static void Test1(int id) { }

        public static TestStrcut.TestClass Test2(int id)
        {
            return new TestStrcut.TestClass(id);
        }
    }
}

After invoke command
Embeddinator-4000.exe --gen=c --platform=Windows --out=d:\test\ d:\MyProject\TestStrcut\Test\bin\Debug\Test.dll

I got next result:

 Parsing assemblies...
 Parsed 'Test.dll'
Processing assemblies...
Generating binding code...
 Generated: Test.h
 Generated: Test.c
 Generated: c-support.c
 Generated: c-support.h
 Generated: embeddinator.h
 Generated: glib.c
 Generated: glib.h
 Generated: mono-support.c
 Generated: mono-support.h
 Generated: mono_embeddinator.c
 Generated: mono_embeddinator.h

In header file Test.h i don't get method "Test2".

// <auto-generated>
// This is autogenerated code by Embeddinator-4000.
// Do not edit this file or all your changes will be lost after re-generation.
// </auto-generated>
// ----------------------------------------------------------------------------
#pragma once

#include "glib.h"
#include "mono_embeddinator.h"
#include "c-support.h"

MONO_EMBEDDINATOR_BEGIN_DECLS

typedef MonoEmbedObject Test_Tst;

MONO_EMBEDDINATOR_API void Test_Tst_Test1(int32_t id);

MONO_EMBEDDINATOR_END_DECLS

What's problem? Why i don't get this method.

petrivanovivanovich80 avatar Aug 15 '18 13:08 petrivanovivanovich80

Thanks for the report. I will tag the issue accordingly so that you get the required information ASAP.

mandel-macaque avatar Aug 16 '18 10:08 mandel-macaque