error using mex with external library with extra qualifiers
显示 更早的评论
Hello,
I am trying to compile a mex function with an external .cpp library which has extra qualifiers. How can I call the functions from external library that has extra qualifiers?
If I don't add the qualifier the error is:
C:\Users\rdeshpande\DS10ep_workspace\MatlabProspectra\mfiles\cprogram\CallMathLib.cpp:29:47: error: 'Add' was not declared in this scope
plhs[0] =mxCreateDoubleScalar (Add(no1,no2));
If I add the extra qualifier in this call
plhs[0] =mxCreateDoubleScalar (MathLibrary::Functions::Add(no1,no2));
The error is: Building with 'MinGW64 Compiler (C++)'. Error using mex C:\Users\RDESHP~1\AppData\Local\Temp\mex_245413811332369_15808\CallMathLib.obj:CallMathLib.cpp:(.text+0xab): undefined reference to `__imp__ZN11MathLibrary9Functions3AddEdd' collect2.exe: error: ld returned 1 exit status
2 个评论
James Tursa
2017-6-15
What is the mex command you are using? How are you linking in the MathLibrary?
Rucha Deshpande
2017-6-16
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!