Error while creating MAT files from C++
Show older comments
I am new to Matlab. I am working on a program which is in C and C++(IDE iam using for this is Visual Studio 2010 Pro) in which I need to use MATLAB functions (for example create and read a MAT-file). I donot have MATLAB installed on my machine.
After going through the documentation, I found out it can be done by including and linking matlab file in my project(mat.h,matrix.h,libmat.lib,libmx.lib) which I got from the MATLAB install I have on my other machine.
Following the steps directed in the documentation I got to a point where I am writing some basic code to create an mxarray and dump some values into it which is written to a MAT-file.
After compiling my code, I get an error in matrix.h saying "error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ..\matrix.h 319 Test". which points me to "typedef CHAR16_T mxChar;" in matrix.h.
I donno know if I am missing. Any help will be appreciated.
Thanks
2 Comments
Walter Roberson
on 29 Nov 2011
Please edit your question to be more readable.
ashmah24
on 29 Nov 2011
Answers (1)
Kaustubha Govind
on 29 Nov 2011
0 votes
You need to perform the compilation/linking process using the MEX command and an options-file that ships with MATLAB. I would recommend compiling your application in MATLAB, and then deploying it to whichever machine you need it on, along with the dependent libraries. See Compiling and Linking MAT-File Programs for guidance with the compilation, linking and deployment.
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!