As has already been said, simple data types are required for the transfer to a C - DLL.So you have to copy everything.
This is somewhat annoying and you also need a function at the end that cleans up the stuff.
typedef struct FACESTRUCT {
size_t n;
FACESTRUCT *next;
double *dat;
} FACETYPE;
extern "C" __declspec(dllexport) FACETYPE* PrepareFaceBankC(char* path);
std::vector<std::vector<double>> cdecl PrepareFaceBank(std::string Path);
FACETYPE* PrepareFaceBankC(char* path)
{
std::vector<std::vector<double>> facebank;
std::string mypath(path);
FACETYPE *myhead = NULL, *mylst, *tmp;
facebank = PrepareFaceBank(mypath);
size_t n = (facebank.size());
for (size_t i = 0; i < n; i++) {
std::vector<double> mydat = facebank.at(i);
tmp = (FACETYPE*)malloc(sizeof(FACETYPE) * n);
tmp->next = NULL;
tmp->n = mydat.size();
tmp->dat = (double*)malloc(sizeof(double) * tmp->n);
for (size_t k = 0; k < tmp->n; k++) {
tmp->dat[k] = mydat.at(k); }
if (myhead == NULL) {
myhead = tmp; mylst = tmp;
}
else {
mylst->next = tmp; mylst = tmp;
}
}
return myhead;
}
This is just a rough draft to show how it might be done...