error using mex function

조회 수: 7 (최근 30일)
Reza Kharghanian
Reza Kharghanian 2018년 5월 20일
댓글: Reza Kharghanian 2018년 5월 21일
I am using Matlab 2018a and Microsoft Visual Studio 2017community which is compatible with Matlab 2018a, I wanted to use svmlin of Vikas Sindhwani(<http://vikas.sindhwani.org/svmlin.html)>. But when I execute "mex svmlin_mex.cpp ssl.o" command in the command window, the following errors appear: I tried with different compilers: 1-Building with 'MinGW64 Compiler with Windows 10 SDK or later (C++)'.:
2- Building with 'Microsoft Visual C++ 2017'.
3- Building with 'MinGW64 Compiler (C++)'.
What is the problem and how it can be overcome?
  댓글 수: 1
Jan
Jan 2018년 5월 20일
Please post the text as text, because reading the screenshots is very inconvenient.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2018년 5월 20일
편집: Jan 2018년 5월 20일
The error messages are clear:
You try to store a mwIndex* in a int*, but you cannot expect, that they are compatible. The best solution is to define Data.colind with the correct type mwIndex*. The types int* and long long unsigned int* are simply different.
You would cause a crash, if your int* does not have the same width as mwIndex*. The sign matters also. So better rely on using correct types, even so it might "work" sometimes.
  댓글 수: 3
Jan
Jan 2018년 5월 21일
편집: Jan 2018년 5월 21일
You have to change the code, which defines the "struct data". This is one of the .h files you have included before. I strongly recommend not to do this, if you are not familiar with C, but to ask the author to fix the code.
Reza Kharghanian
Reza Kharghanian 2018년 5월 21일
Since I am not expert in C, I probably ask the author to update the code. thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by