Borrar filtros
Borrar filtros

MEX function cannot be called without its file extension.

2 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Agapi Dav
Agapi Dav el 12 de Sept. de 2018
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!

Más respuestas (0)

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by