c# - Use extern c++ dll in Unity3D 5 -
i wrote c++ dll want use in unity3d. put assets/plugins , wrote c# script should access function of error:
entrypointnotfoundexception: multiply
test.start () (at assets/scripts/test.cs:11)
manager.h:
extern "c" { class manager { public: __declspec(dllexport) float multiply(float a, float b); }; }
manager.cpp:
#include "manager.h" extern "c" { float manager::multiply(float a, float b) { return * b; } }
c# script:
[dllimport("manager", callingconvention = callingconvention.cdecl, charset = charset.unicode)] private static extern float multiply(float a, float b); void start() { debug.log(multiply(10, 2)); }
edit: doesn't work during i'm using class. use class have this
Comments
Post a Comment