DLL Import

Hi all, I am trying to import a few DLLs into Unity and I was wondering really where I’m going wrong. I have a third party DLL and its source and I am trying to get it to spit out something other than an error. Unity seemingly takes in the DLL but reports an EntryPointNotFoundException every time I try to get it to attach to a function. I have a program that reports all functions in a DLL and I’m using that to try and call SOMETHING from the DLL. So far no luck, let me know if you guys need any samples or anything.

Well, if you have a static extern declaration in your managed code the DLL usually is native code and not managed. Managed code DLLs don’t need to be “imported”. You just add them to your project, just like your scripts. So i guess it’s a native DLL.

Unity can only read DLLs which export their functions as c-functions and not as C++ functions. In short there must be no name mangling. That’s why Unity suggests to put your method exports into an extern “C” block. If you don’t have access to the DLL’s source there’s not much you can do here.

Also if you target PC / Standalone, make sure you have Unity pro since native plugins are a pro or mobile feature. You can’t use native plugins on PC with Unity free.