MATLAB Answers

Mex Out of Process with MinGW/MSYS2 and GSL

4 ビュー (過去 30 日間)
Kristen Bruchko
Kristen Bruchko 2020 年 6 月 23 日
コメント済み: Kristen Bruchko 2021 年 6 月 1 日
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 件のコメント
Kristen Bruchko
Kristen Bruchko 2021 年 6 月 1 日
My problem ended up being the API I was using. I still had my mex file setup with the C Matrix API (with the mxArray data structure), but the out-of-process only works with the new C++ Mex API. You can find more details about the C++ API here. Hopefully your issue is that simple of a fix as well.

サインインしてコメントする。

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by