简体   繁体   English

无效的Mex功能

[英]Invalid Mex-function

I am quite experienced with matlab mex functions, but I am having a problem very difficult to solve. 我对matlab mex函数非常有经验,但是我有一个很难解决的问题。

I am receiving a message like this: 我收到这样的消息:

Invalid MEX-file 'mymex.mexw64': The specified procedure could not be found. 无效的MEX文件'mymex.mexw64':找不到指定的过程。

Normally, this problem is related to missing dlls. 通常,此问题与丢失的dll有关。 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. 另外,我使用“替代”软件进行了检查,例如:ProcessMonitor,ProcessExplorer,CFF_Explorer ...等。 I have tried everything. 我已经尝试了一切。

The problem started when I tried to migrate an old code from Matlab2012 to Matlab2015. 当我尝试将旧代码从Matlab2012迁移到Matlab2015时,问题就开始了。

In this process : 在这个过程中:

  1. I updated libmx, libmex to the current ones (2015) 我将libmx,libmex更新为当前版本(2015)
  2. Changed qt version to a new version (yes, my mex function uses qt) 将qt版本更改为新版本(是的,我的mex函数使用qt)
  3. Changed platform to v140 (the old one was v110, Visual Studio 2012) 将平台更改为v140(旧版本为v110,Visual Studio 2012)

My only hypothesis is that something with some custom *.lib files used. 我唯一的假设是使用某些带有自定义* .lib文件的文件。 These lib files are compiled in v110, and I am using v140. 这些lib文件是在v110中编译的,而我正在使用v140。 In my distribution package I have included the dlls to both Visual C++ Redistributable Packages v110 e v140. 在我的分发程序包中,我已经将dll包含在两个Visual C ++可再发行程序包v110和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 我还没有测试过删除这些* .libs,因为这会很痛苦

My questions are: 我的问题是:

  1. Is my hypothesis valid? 我的假设有效吗?
  2. Does anyone know how to solve this? 有谁知道如何解决这个问题?

I figured out the answer myself. 我自己想出了答案。 It turns out that simulink uses qt internally. 事实证明simulink在内部使用qt。 So, the Dlls from my custom app is conflicting with simulink QT dlls. 因此,来自我的自定义应用程序的Dll与simulink QT dll冲突。 Both have the same name, but simulink is using a slightly different version of QT. 两者的名称相同,但是simulink使用的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. QT指出,使用相同的主版本可以具有向后兼容性...但这并非如此,至少在matlab环境中并非如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM