Mex Out of Process with MinGW/MSYS2 and GSL
4 views (last 30 days)
Show older comments
I am trying to use the new mex out of process feature but my mex file only says "Invalid C++ MEX-file" when tried to run with the mexhost. I am compiling a cpp file with 'MinGW64 C++ Compiler' and using GSL-2.6 libraries. I think the second mexhost process cannot access the libraries needed to run the GSL section of my code.
I have the GSL dlls and libraries needed already linked to my PATH user environment variable, I have tried adding the DLLs directly to where my mex function is trying to run, and I have already ran dependency walker and nothing seems to be missing except for the API and EXE dlls which I've come to understand means those aren't missing, but something else is.
How can I make the second mexhost process have the same access to the dlls and libs as the main process? The purpose I am trying to do this for is to prevent Matlab from closing when the mex function errors out, I'd rather have that second process end and be able to debug the reason than have to go into a Matlab crash report. I am using 2019b and 2020a on two computers, both have the same issue.
2 Comments
Evangelos Paradas
on 31 May 2021
I have the same problem.
I also tried with the dependency walker and nothing is missing.
Strangely, if I try to run my MEX outside of the mexhost (without the feval) it runs.
Any ideas?
Answers (0)
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!