Unity Pro can't find DLL

I created a basic test DLL which contains a single cpp file with the following code:

extern “C”
{
int DoubleNumber( int i )
{
return i + i;
}
}

I copy the DLL (compiled with VS2008) and place it into my project Plugins directory.
The DLL is referenced in a C# script as follows:

[DllImport("Test.dll")]
public static extern int DoubleNumber( int i );

The code builds fine, but when I run the game I get the error: “DllNotFoundException: Test.dll”.

Any idea why this might be happening?

Thanks.

Hi,

You have to give only the plugin name . instead of test.dll you have to give only as test.

if its for IOS you need to give like [DllImport(“__Internal”)] otherwise you can provide only plugin name like [DllImport(“Test”)].

Dont forget to drag your dll into Plugins folder. for more reference,

http://unity3d.com/support/documentation/Manual/Plugins.html