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

4 ビュー (過去 30 日間)
David
David 2014 年 2 月 8 日
編集済み: Sanjay Manohar 2019 年 11 月 5 日
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.
  2 件のコメント
Hannetjie
Hannetjie 2015 年 2 月 27 日
This is the first time in my life I've seen a clarification by means of Turing machine.
Sanjay Manohar
Sanjay Manohar 2019 年 11 月 5 日
編集済み: Sanjay Manohar 2019 年 11 月 5 日
This is the best answer I have ever read. To any question.

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


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 Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by