Search Unity

EntryPointNotFoundException - but entry point exists

Discussion in 'Editor & General Support' started by garrilla, Aug 2, 2019.

  1. garrilla

    garrilla

    Joined:
    Jan 12, 2016
    Posts:
    28
    I have a C/C++ unmanaged DLL that is working with the exception of a single method which causes an
    EntryPointNotFoundException


    i'm setting up the DLL in c#
    Code (CSharp):
    1. private const string dllname = "mydllname";
    2.         [DllImport(dllname)]
    3.         private static extern IntPtr CreateBridge();
    4.  
    5.         [DllImport(dllname)]
    6.         private static extern void DestroyBridge(IntPtr context);
    7.  
    8.         [DllImport(dllname)]
    9.         private static extern int getChannels(IntPtr context);
    10.  
    11.         [DllImport(dllname)]
    12.         private static extern void setUpdate(IntPtr context, IntPtr values);
    and then calling the method
    Code (CSharp):
    1.  
    2.                 IntPtr updatePtr = Marshal.AllocHGlobal(Marshal.SizeOf(update));
    3.                 Marshal.StructureToPtr(update, updatePtr, true);
    4.                 setUpdate(context, updatePtr);
    Before I'm calling
    setUpdate(context, updatePtr)
    I'm successfully calling
    CreateBridge() 
    and
    getChannels(IntPtr context)
    so we know the DLL is present, that it is loaded and that other entryPoints can be called

    But
    setUpdate(context, updatePtr)
    causes the exception
    EntryPointNotFoundException



    the C definition is as follows
    Code (C):
    1.  
    2. #define DLL_EXPORT __declspec(dllexport)
    3.  
    4. ...
    5.  
    6. extern "C" {
    7.     DLL_EXPORT  UnityBridge* CreateBridge();
    8.     DLL_EXPORT void DestroyBridge(const UnityBridge* _unitybridge);
    9.     DLL_EXPORT int getChannels(UnityBridge* _unitybridge);
    10.     DLL_EXPORT void setUpdate(UnityBridge* _unitybridge, Update* update);
    11. }
    What else can cause this exception?