フィルターのクリア

Still having problems loading libraries with 2015a and windows 10

3 ビュー (過去 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 Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by