Error when Import C plus library to matlab

3 views (last 30 days)
GreenPiece
GreenPiece on 25 Nov 2018
Hi everyone,
I am trying to import a C++ library (.dll,.lib) to Matlab.
But there is some error as follows
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'intclasscomplib{public:void' was not found. Defaulting to type error.
Found on line 21 of input from line 20 of file CompLib.h
*********
Error using loadlibrary
Building myCppLib_thunk_pcwin64 failed. Compiler output is:
cl -I"G:\Program Files\MATLAB\R2016a\extern\include" /W3 /nologo /D_CRT_SECURE_NO_DEPRECATE
/D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 -
"myCppLib_thunk_pcwin64.c" -LD
-Fe"myCppLib_thunk_pcwin64.dll"
myCppLib_thunk_pcwin64.c
\CompLib.h(6) : error C2061: syntax error : identifier
'complib'
\CompLib.h(6) : error C2059: syntax error : ';'
\CompLib.h(6) : error C2449: found '{' at file scope (missing
function header?)
\CompLib.h(20) : error C2059: syntax error : '}'
myCppLib_thunk_pcwin64.c(50) : fatal error C1004: unexpected end-of-file found
I think this guy had a same problem:
But there is no solution for this problem.
I have succeed in importing the library to another application in Visual studio so surely my librariy is proper.
Please suggest me as well as other customer a solution for this problem.
Thank you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!