error using mex function
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Reza Kharghanian
il 20 Mag 2018
Commentato: Reza Kharghanian
il 21 Mag 2018
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 Commento
Jan
il 20 Mag 2018
Please post the text as text, because reading the screenshots is very inconvenient.
Risposta accettata
Jan
il 20 Mag 2018
Modificato: Jan
il 20 Mag 2018
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Write C Functions Callable from MATLAB (MEX Files) in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!