Invalid Mex-function

与世无争的帅哥 提交于 2019-12-11 05:36:01

问题


I am quite experienced with matlab mex functions, but I am having a problem very difficult to solve.

I am receiving a message like this:

Invalid MEX-file 'mymex.mexw64': The specified procedure could not be found.

Normally, this problem is related to missing dlls. However, I checked several times with dependency walker and nothing is missing.

Also, I checked with "alternative" softwares, eg: ProcessMonitor, ProcessExplorer, CFF_Explorer... and so on. I have tried everything.

The problem started when I tried to migrate an old code from Matlab2012 to Matlab2015.

In this process :

  1. I updated libmx, libmex to the current ones (2015)
  2. Changed qt version to a new version (yes, my mex function uses qt)
  3. Changed platform to v140 (the old one was v110, Visual Studio 2012)

My only hypothesis is that something with some custom *.lib files used. These lib files are compiled in v110, and I am using v140. In my distribution package I have included the dlls to both Visual C++ Redistributable Packages v110 e v140. I am not sure if this is possible, although the source code is compiling just fine.

I have not tested removing these *.libs, because this would be quite painful

My questions are:

  1. Is my hypothesis valid?
  2. Does anyone know how to solve this?

回答1:


I figured out the answer myself. It turns out that simulink uses qt internally. So, the Dlls from my custom app is conflicting with simulink QT dlls. Both have the same name, but simulink is using a slightly different version of QT.

QT states that using the same major version you can have backwards compatibility... But that is not the case, at least not in matlab environment.



来源:https://stackoverflow.com/questions/46036696/invalid-mex-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!