Still having problems loading libraries with 2015a and windows 10
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (2개)
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
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
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 Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!