in reply to Re^4: Import a DLL from C# to Perl
in thread Import a DLL from C# to Perl

... the DLL contains initialisation and thunking code to connect it to the .NET subsytems, that needs to be called for stuff to work

I can't claim to have any knowledge about C#, but I think that paulorfmmb has indicated that he can access his C#-built dll from C code (presumably using his MS C compiler to build the C executable).
I was thinking that if the same dll cannot be accessed by an executable built from the same C code, but built with a gcc (mingw-w64) compiler, then it's because of a difference in the environment under which the gcc-built executable is running.
If that's so, then it's just a matter of fixing the environment when running the gcc-built executable.

However, I guess it's also possible that building the executable with a Microsoft compiler does stuff that doesn't get done when building with gcc - and that this explains the failure of gcc-built apps to deliver.

Or, FAIRK, maybe the problem is something entirely different again.

Cheers,
Rob

Replies are listed 'Best First'.
Re^6: Import a DLL from C# to Perl
by BrowserUk (Patriarch) on May 10, 2018 at 05:35 UTC
    I guess it's also possible that building the executable with a Microsoft compiler does stuff that doesn't get done when building with gcc

    If he's building stuff using the VS GUI,or one of the XML build files it generates; it likely doing a crap load of stuff that he hasn't explicitly asked for.

    (eg. I think if you ask VS to link a C program to a C# dll, it knows to add (unseen) code to initialise the .NET runtime. (*I think*))

    That said, I don't use gcc, so maybe that knows how to do all that stuff (now).


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit