cplex for matlab,How to operate cplex on matlab?

This issue can arise if the MEX-file depends on a shared library that also ships with MATLAB. This is an unsupported workflow and is never guaranteed to work, but if it is to have any chance of working, the MEX-file and its dependencies must be built against the same version of the library as is shipped with MATLAB. The MEX-file may try to use the shipped version of the library at run-time, and if this is different from the version used in building the MEX-file, MATLAB may throw the above error, or even crash.

On Windows machines, you can investigate whether the issue is due to conflicting shared libraries by using Dependency Walker. This is a third-party program available at

www.dependencywalker.com

After downloading Dependency Walker, take the following steps: Launch MATLAB

Navigate to the directory containing the Dependency Walker executable (depends.exe) Execute the following command at the MATLAB prompt

>> !depends.exe full path to MEX-file

The left-hand pane of Dependency Walker will show where each DLL is loaded from (you may need to right-click on the pane and select "Full paths"). Look for entries with a red icon a file path in the MATLAB file hierarchy.

For each such entry, scroll through the upper right pane of Dependency Walker and look for red icons in the left-most column. These indicate function calls for which the external and shipped versions of the DLL differ. The presence of such differences means that a library conflict is probably the cause of the error message or crash.

There are three potential workarounds. To describe them, I consider the case where "myMex.mexw64" is linked against "myLibrary.dll" which is linked against "conflict.dll". MATLAB ships with v. 1.1 of "conflict.dll," but "myLibrary.dll" was built using v. 1.0. The version of a DLL-file can sometimes be found on the "Details" tab of the "Properties" window for that file. The potential workarounds are:

1.Use the same version of "conflict.dll":

If you have access to the source code for "myLibrary.dll" as well as the header-files for v 1.1 of "conflict.dll", you can rebuild "myLibrary.dll" using v 1.1 of "conflict.dll." This may require changes to the "myLibrary" source code. Note that sometimes the DLL files may differ even though they have the same version number, which can

2.Rename the external version of "conflict.dll":

If you have access to the source code for "myLibrary.dll" as well as the header-files for v 1.0 of "conflict.dll", you can rename the external copy of "conflict.dll" to "conflict_external.dll," and rebuild "myLibrary.dll" such that it is linked against "conflict_external.dll". This could prove to be difficult if there are multiple conflicts.

3.Use a different MATLAB relesase:

Use a release of MATLAB that ships a version of "conflict" for which the DLL name is different. This is what made R2011b work in the OpenSceneGraph case described above.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值