MEX function cannot be called without its file extension.

조회 수: 2 (최근 30일)
Agapi Dav
Agapi Dav 2018년 9월 12일
댓글: Thanaphong Phongpreecha 2019년 7월 17일
Hello everyone!
I was trying to run a code in Linux that in Windows runs without any error. It outputs an error “Undefined function or variable 'convConst'.”
The convConst function is a MEX file and solutions suggested to add the folder in the path.
I used “addpath” and added the folder to the path, but the problem remains.
When I use “which convConst” I have the following outputs:
>> which convConst
convConst' not found.
>> which convConst.cpp
/home/chung/Documents/agapi/Other_approaches/02_DehazeNet/DehazeNet-master/convConst.cpp
>> which convConst.mexw64
/home/chung/Documents/agapi/Other_approaches/02_DehazeNet/DehazeNet-master/convConst.mexw64
Any ideas on how to fix the problem?
I use Matlab R017b and Linux Mint 19.

채택된 답변

Agapi Dav
Agapi Dav 2018년 9월 12일
Ok, I found the solution. The file extension of the MEX file indicated that it should be compiled in Linux.
Thus, I used the command mex followed by the path of the .cpp file and it compiled perfectly. Now the function is callable when I type "convConst".
Cheers!

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