필터 지우기
필터 지우기

I' m unable to run cpp code in Matlab using mex command. I'm getting following errors.

조회 수: 1 (최근 30일)
Error combatgun2.c: 2280 undeclared identifier `new' Error combatgun2.c: 2280 operands of = have illegal types `pointer to COMBATSTATE' and `int' Warning combatgun2.c: 2280 possible usage of new before definition Error combatgun2.c: 2280 syntax error; found `COMBATSTATE' expecting `;'
What should I do? I tried alot. Thanks in advance.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 6월 6일
I think you should name your file with the .cpp extension if you have C++ code in it, so the compiler knows to treat it like one. The error about "undeclared identifier `new' " seems to suggest that it is currently compiling as C code. Also make sure that you have selected a compiler that can handle C++ with "mex -setup" (for example, the LCC compiler that ships with MATLAB on 32-bit Windows installation is a C-only compiler).
  댓글 수: 1
Amit Kalhapure
Amit Kalhapure 2012년 6월 6일
Yes, you are right. Thanks alot. I got the detail solution from the below link.
http://www.mathworks.in/support/solutions/en/data/1-D5W493/?solution=1-D5W493

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

추가 답변 (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