Can I load a 32-bit Dll library into a 64-bit version of MATLAB?

6 次查看(过去 30 天)
Is it possible to load a 32-bit DLL library into a 64-bit version of MATLAB? Using the loadlibrary command generates an error--are there any reasonable workarounds to this problem?

回答(2 个)

Walter Roberson
Walter Roberson 2014-2-8
No you cannot do it in MATLAB, and there are no reasonable work-arounds other than using a 32 bit version of MATLAB.
I don't think it is impossible in theory, as it would be similar to using a two-tape Turing Machine; two-tape Turing machines can be turned into one-tape Turing machines by expanding the symbol set to the cross-product of all symbols on each tape. But importing more than (2^32) 64-bit addresses into 32 bit address space does get somewhat dicey.

Daniel Goerke
Daniel Goerke 2017-10-9
I also need to load a 32-bit DLL into a MATLAB using loadlibrary().
Unfortunately the 32-bit family of MATLAB is not supported in the latest version: https://de.mathworks.com/support/sysreq/roadmap.html
Did any kind of workaround come up to load 32-bit DLLs in 64-bit MATLAB (R2017b or later)?
Best regards, Daniel
  1 个评论
Guillaume
Guillaume 2017-10-9
编辑:Guillaume 2017-10-9
Please don't use the answer box for what is just a comment.
There are and never will be a workaround for this. Windows does not allow any 64-bit program to load any 32-bit dll.
If no 64-bit version of that dll exists and you cannot recompile it as 64-bit the only thing you can do is create a surrogate 32-bit exe which loads the 32-bit dll and a surrogate 64-bit dll that relay the calls from matlab to the exe through interprocess communication. This is not a trivial thing to do but is possible. As stated in the article, the work involved is probably as much as just rewriting the dll as 64-bit.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by