I want to read some .mat file containing nested structs to use the data for a QT-GUI. So I'm using QT Creator.
My problem right now is, that I don't know what Files I need to call the read functions. Right now I just very simply add all *.h files from matlabroot/extern/include and the file libmat and libmx from matlabroot/bin/win64 to my sourcecode directory.
My code looks like this
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "mat.h"
int main()
{
MATFile* pmat;
std::string filename = "x.mat";
const char* file = filename.c_str();
printf("Reading file %s...\n\n", file);
pmat = matOpen(file, "r");
if (pmat == NULL) {
printf("Error opening file %s\n", file);
return (1);
}
return 0;
}
I always get the error undefined reference to 'matOpen' but matOpen should be in mat.h.
I just want to run a small minimal example to at least call some of the matlab c++ functions. So I need to know which files are really necessary to put in my working directory.
I'm not really experienced with using someone else's code.