Still having problems loading libraries with 2015a and windows 10

조회 수: 1 (최근 30일)
Tim G.
Tim G. 2015년 8월 28일
댓글: Philip Borghesani 2015년 9월 2일
Further to my previous question, I tried following the example in the loadlibrary() help menu:
>> matlabroot
ans =
C:\Program Files\MATLAB\R2015a
>> addpath(fullfile(matlabroot,'extern','examples','shrlib'))
>> loadlibrary('shrlibsample')
Index exceeds matrix dimensions.
Error in loadlibrary>getLoadlibraryCompilerConfiguration (line 527)
Error in loadlibrary (line 263)
Can someone please explain why I can't even load the dll example that is in the matlab help? Is this a windows 10 compatibility problem?

답변 (2개)

Shruti Sapre
Shruti Sapre 2015년 9월 1일
Hi Tim,
I understand that you are trying to load the dll from example on the Mathworks help page. The error you mentioned could be due to absence of a supported compiler on your machine.
Please refer to the link below for limitations of “loadlibrary”:
The below command could help confirm the presence of a supported compiler:
>> mex setup
"mex" has to be setup to point to a supported compiler.
If there is no compiler installed, please install a supported compiler and try again. Here is a link that lists the supported compilers:
Hope this helps!
-Shruti
  댓글 수: 1
Tim G.
Tim G. 2015년 9월 1일
Shruti,
I am confused as to why i need to have a compiler installed on my system in order to open and access a pre-existing DLL.
Regardless, I have the sdk 7.1 and MS Visual Studio 2013 Professional installed. I also have perl installed.
When i type mex -setup i get an error
>> mex -setup
Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2015a/win64.html.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2015년 9월 1일
I have not yet seen any evidence that SDK 7.1 can be installed on Windows 10; there is a conflict with .NET versions that I have not seen resolved yet.
loadlibrary() that is not given a prototype file must be supplied with a .h file that lists the available routines and the datatypes of the output and of all of the inputs. It then requires a compiler (or at least pre-processor perhaps) to build from that a MATLAB-readable description that can be used to convert inputs and outputs in order to call the routine successfully.
When you succesfully use loadlibrary() with a header file, there is an option to output from that a prototype file which MATLAB can use instead without needing a compiler. That prototype file can be used on systems without compilers, or can be deployed with an application compiled with MATLAB Compiler. Therefor if you still have access to a Windows system with a compiler and with MATLAB, you could generate the prototype file on there and copy it to your Windows 10 system.
  댓글 수: 1
Philip Borghesani
Philip Borghesani 2015년 9월 2일
Walter is correct for 32 bit systems. On 64 bit systems a thunk file (dll) is also required to load the library. This file is automatically built from generated c code by the loadlibrary command using the configured compiler but can be copied and used on other systems that do not have a compiler.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by