Error while loading library

10 Ansichten (letzte 30 Tage)
Xiaofei Yu
Xiaofei Yu am 17 Nov. 2019
Beantwortet: carlos saavedra am 7 Sep. 2022
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 Kommentar
Walter Roberson
Walter Roberson am 17 Nov. 2019
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 .

Melden Sie sich an, um zu kommentieren.

Antworten (1)

carlos saavedra
carlos saavedra am 7 Sep. 2022
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

Kategorien

Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by