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 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