I am trying to read a mat-file in an own mat_file_read.cpp in a Qt project, and I am having problems. My error:
error lnk2019: unresolved external symbol matOpen referenced in function "int __cdecl read_mat_file(class QString)" (?read_mat_file@@YAHVQString@@@Z)"
In my project.pro, I am including:
INCLUDEPATH += C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include\
LIBS += -LC:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\win64
-llibmx
-llibmat
-llibeng
In the header of my cpp file:
#include <stdio.h>
#include <stdlib.h>
#include "mat.h"
#include "matrix.h"
#include <QString>
#include <QFileDialog>
In my mat_file_reader.cpp:
#include "read_mat_file.h"
int read_mat_file(QString file)
{
// Variable definition
int result;
MATFile *pmat;
if (file.isEmpty()) return 0;
QByteArray ba = file.toLatin1();
const char *rootFile = ba.data();
pmat = matOpen(rootFile,"r");
result = 0;
return (result==0)?EXIT_SUCCESS:EXIT_FAILURE;
}
And the curious thing is the Qt editor is recognizing the functions from "mat.h". It is suggesting me the functions....
Thanks so much in advance.