Open HYCLEN opened 8 years ago
Hi, it seems that your compiler does not understand double slashed style comments http://stackoverflow.com/questions/2223541/why-cant-i-use-style-comments-in-my-c-code
You should either delete comment lines, beginning with //
or replace each //
"double-slashed" comment with /* */
style comment
e.g. replace // if (!mxIsChar(prhs[3]) || mxGetN(prhs[3])>1) {
with /* if (!mxIsChar(prhs[3]) || mxGetN(prhs[3])>1) { */
Hope this helps
Thank you for your comment. I have made correction and compile works well now. However, when I try to implement the function matlab is suddenly crashed with error messages.
double free or corruption (out): 0x00007fefb559e0d0 ***
Hmm, seems that there is some problem with memory allocation/freeing. You could try this solution http://stackoverflow.com/questions/24085098/mxcalloc-and-mxfree-with-openmp-results-double-free-or-corruption
I'd be very interested in a solution. Works great on my windows machine but not on linux.
Tried replacing some mx functions with their C counterparts such as calloc and free. Still getting the double free error. I'm not very good with C so I wouldn't know how to change all of the functions with 'mx' in them.
Hi, how did you use it in linux?when I mex the .c in the command window of matlab,several error came out , and I'm not good with C.
Hi,
Thanks for providing this helpful code. It is what I just needed. I just need some more details on how to run it in linux system. I have run it in windows and there was no problem. However, when I tried it in linux, several error messages came out and I think it was probably related to compile issue. Error is like following:
Building with 'gcc'. Error using mex /mex_WriteMatrix.c:6:1: error: expected identifier or ‘(’ before ‘/’ token /mex_WriteMatrix.c:8:1: error: expected identifier or ‘(’ before ‘/’ token /mex_WriteMatrix.c:10:35: warning: character constant too long for its type [enabled by default] /mex_WriteMatrix.c:11:54: warning: character constant too long for its type [enabled by default] /mex_WriteMatrix.c:13:31: warning: multi-character character constant [-Wmultichar] /mex_WriteMatrix.c:13:55: warning: multi-character character constant [-Wmultichar] /mex_WriteMatrix.c: In function ‘mexFunction’: /mex_WriteMatrix.c:110:1: error: expected expression before ‘/’ token /mex_WriteMatrix.c:157:1: error: expected declaration or statement at end of input
It will be greatly helpful for me if let me know how to fix it. Thank you again!