How to use Dll file in unity and EntryPointNotFoundException:

I made a Dll file in visual studio 2010 and imported it to unity but unable to access functions-
the code goes like this-

the header file contains-

namespace MathFuncs
{

class MyMathFuncs
{
public:
    // Returns a + b
    static __declspec(dllexport) double Add(double a, double b);

    
};

}

the cpp file contains-#include “MathFuncsDll.h”

#include

using namespace std;

namespace MathFuncs
{

double MyMathFuncs::Add(double a, double b)
{
    return a + b;
}

}

and the unity c# script goes this way-
using UnityEngine;

using System.Runtime.InteropServices;

class dllcheck : MonoBehaviour {

[DllImport(“MathFuncsDll”)]

private static extern double Add(double a, double b);

void Awake() {

	Debug.Log(Add(5.0,7.0));    //shows runtime error pointing this line

}

}

and the error goes this way-
EntryPointNotFoundException: Add
dllcheck.Awake () (at Assets/Scenes/dllcheck.cs:17)

please help me out as i am stuck with my work.

Thanks in advance.

Loosk liek you took the MSDN example to make teh dll. IF thats true,then your unity c# code to read it should something like this:

class PluginTestCpp : MonoBehaviour 
{
   //the dll mus be in the root project dir
   //i used the dependency walker.exe program to see inside teh dll, and find its wierd mangled name/entry point, and pasted it here.
   [DllImport ("testDLL.dll", EntryPoint="?Multiply@MyMathFuncs@MathFuncs@@SANNN@Z")]
   //[DllImport ("myDll.dll", EntryPoint="function_name")]

   private static extern double Multiply(double a, double b);

   void Awake () 
   {
      print (Multiply (2,34));
   }
} 

on this line:

 [DllImport ("testDLL.dll", EntryPoint="?Multiply@MyMathFuncs@MathFuncs@@SANNN@Z"

you need to crack open your DLL file to get the name of the methods you want to use.(i forgot how to do it, theres programs out there to see teh contents)