I try to use the functions from a .bundle file inside Unity3D but every time when I call the functions I get the error:
DllNotFoundException: libant
connectANT.Start () (at Assets/connectANT.cs:13)
This is the script that I use to call the library antlib.bundle which is in the Assets/Plugin folder:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class connectANT : MonoBehaviour {
[DllImport("libant")] static extern bool ANT_Init(int ucUSBDeviceNum_, int ulBaudrate_);
void Start () {
ANT_Init (1, 50000);
}
}
in the bundle this function is declared like this:
#ifdef __cplusplus
extern "C" {
#endif
EXPORT BOOL ANT_Init(UCHAR ucUSBDeviceNum_, ULONG ulBaudrate_); //Initializes and opens USB connection to the module
#ifdef __cplusplus
}
#endif
This is just an example with only one function from the bundle. If I just import the functions in my script I don't get any error in Unity. Can someone help me to figure it out?