matlab - Read Mat Files in C++ in a Qt project -
i trying read mat-file in own mat_file_read.cpp in qt project, , having problems. error:
error lnk2019: unresolved external symbol matopen referenced in function "int __cdecl read_mat_file(class qstring)" (?read_mat_file@@yahvqstring@@@z)"
in project.pro, 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 header of cpp file:
#include <stdio.h> #include <stdlib.h> #include "mat.h" #include "matrix.h" #include <qstring> #include <qfiledialog>
in 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 curious thing qt editor recognizing functions "mat.h". suggesting me functions....
thanks in advance.
finally found solution, although don't understand fine why.... changed next lines in project.pro of qt:
includepath += c:\program files\matlab\matlab production server\r2015a\extern\include\ libs += -llibmx -lc:\librerias\matlab\extern\lib\win64\microsoft libs += -llibmat -lc:\librerias\matlab\extern\lib\win64\microsoft libs += -llibeng -lc:\librerias\matlab\extern\lib\win64\microsoft
now working.... it's strange think, me it's ok. :)
thanks @suever support.
Comments
Post a Comment