필터 지우기
필터 지우기

MEX: errors with other compiler

조회 수: 1 (최근 30일)
mick strife
mick strife 2013년 5월 2일
Hello,
i changed the compiler for my mex-script. unfortunately i get some errors now. how can i fix these errors? Many thanks as always :)
demo.cpp(800) : error C2440: '=' : cannot convert from 'const mxArray *' to 'mxArray *' Conversion loses qualifiers
demo.cpp(807) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
demo.cpp(817) : error C2440: '=' : cannot convert from 'void *' to 'float *'

채택된 답변

James Tursa
James Tursa 2013년 5월 2일
편집: James Tursa 2013년 5월 3일
To get the error messages to go away you can probably do this:
Line 800: Put an explicit (mxArray *) cast in the code.
Line 817: Put an explicit (float *) cast in the code.
But you should look at the code in more detail, particularly line 800, to make sure that what is going on is actually OK for the code to do. The compiler is trying to help you here. Why are you passing something that is supposed to be const to something that is not expecting a const? Will it be changed downstream in your code when it was supposed to stay constant?
  댓글 수: 1
mick strife
mick strife 2013년 5월 3일
Thx james as always :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by