Error while loading library

10 次查看(过去 30 天)
Xiaofei Yu
Xiaofei Yu 2019-11-17
Hi
After using loadinglibaray command.
% loadlibary(dll name, header file name) : Load a DLL into memory so that MATLAB can call it.
loadlibrary('Madlib', 'Madlib');
I got following error
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/struct([^;,{(]*){ <-- HERE (.*?)\}([^;])*;/ at C:\Program Files\MATLAB\R2019b\toolbox\matlab\general\private\prototypes.pl line 912.
*********
Error using loadlibrary
Building Madlib_thunk_pcwin64 failed. Compiler output is:
C:\ProgramData\MATLAB\SupportPackages\R2019b\3P.instrset\mingw_w64.instrset\bin\gcc -I"C:\Program Files\MATLAB\R2019b\extern\include" -fexceptions -fno-omit-frame-pointer
-I"C:\Users\maurerlab\Documents\MATLAB" -I"C:\Program Files\Mad City Labs\NanoDrive\C Example" "Madlib_thunk_pcwin64.c" -o "Madlib_thunk_pcwin64.dll" -shared
In file included from C:\Program Files\MATLAB\R2019b\extern\include/tmwtypes.h:39:0,
from Madlib_thunk_pcwin64.c:22:
C:\Program Files\Mad City Labs\NanoDrive\C Example/Madlib.h:28:24: error: two or more data types in declaration specifiers
typedef unsigned char bool;
^
In file included from Madlib_thunk_pcwin64.c:27:0:
C:\Program Files\Mad City Labs\NanoDrive\C Example/Madlib.h:28:2: warning: useless type name in empty declaration
typedef unsigned char bool;
^~~~~~~
The code worked well in the order matlab version 2018, I am not sure if it's due to the newest version of matlab or maybe I need to set up extra things?
The file (Madlib) being loaded in this case should be corrct since they were used to work in the order version, any help would be appreciated
  1 个评论
Walter Roberson
Walter Roberson 2019-11-17
typedef unsigned char bool;
That would be a problem if bool was already defined as a datatype.
You should check your Madlib.h and consider removing that typedef .

请先登录,再进行评论。

回答(1 个)

carlos saavedra
carlos saavedra 2022-9-7
I have the same problem, were you able to solve this issue?
You can also reach out to me at doomer115@gmail.com to continue this discussion.
Thanks

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by