Invalid ELF Header?

조회 수: 21 (최근 30일)
Stacey
Stacey 2016년 1월 11일
댓글: Stacey 2016년 1월 13일
I'm trying to run a simulation that contains an S-function (originally created in C) and I keep getting the error "Invalid MEX file......Invalid ELF header". Can anyone tell me what I might be doing wrong? I had no issues when I was running this in Windows and I'm not sure why Linux keeps returning this error. I don't know much about ELF headers and I would really appreciate it if someone could explain to me what I am doing wrong here.

채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 12일
The S function needs to be recompiled for Linux .
  댓글 수: 8
Walter Roberson
Walter Roberson 2016년 1월 13일
You might be able to add one of -ansi, -std=c++98, or -std=c++03 between the "mex" and the filename. g++ usually pays attention to the last occurrence of an argument.
There is probably a make file that can be edited or perhaps an XML file used by mex -setup -- it would depend which MATLAB version you are using.
Stacey
Stacey 2016년 1월 13일
Adding those between "mex" and the filename didn't work. I'm not sure where I can find the XML file used by mex -setup and I'm not sure if I would have permission to modify the file since I'm not the admin. I just contacted the admin for the machine to see if we can update gcc. I think that's the easiest thing to do.

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

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