我已经用C ++编写了dll,并且某些函数具有矢量类型。 我想在c#中重做那些值。这是我的代码: C ++:
extern "C" __declspec(dllexport) vector< int> convertA4(char *filePath, char *outPath) {}
c#:
[DllImport("ConsoleApplication1.dll", CallingConvention = CallingConvention.StdCall)]
public static extern List<int> convertA4( string filePath, string outPath );
但是当我运行该应用程序时,已显示此错误:
Cannot marshal 'return value': Generic types cannot be marshaled.