PInvoke - Method's type signature is not PInvoke compatible
See the question and my original answer on StackOverflowThere are multiple problems. First of all your C++ function returns a pointer (emxArray_real_T *) but your import declaration returns a struct. That cannot work. Also, you declare data as double[,] in the import declaration, but as double[] in the structure. Suggestions:
- Replace the struct by a class
- Determine if data should be a double[] or a double[,]
- Also check the final size of real_T. I believe it's a platform dependent variable that could be float (32 bit) or double (64 bit).