Error while obtaining sizes from MEX S-function...need help please
Show older comments
Good evening,
I wrote a c++ mex function while using the template for a C++ example over here https://www.mathworks.com/help/simulink/sfg/s-function-examples.html#f6-61579. I made changes to the code inside the mdl wrappers, that I cannot disclose, but I was able to use the "mex" command to compile the code. Then came the fun part...
I wanted to create an s-function block in simulink that used the c++ mex function I defined, when I tried to run the s-function I got this error
Error while obtaining sizes from MEX S-function '..._cpp' in 'sfunc_.../S-Function'.
Invalid MEX-file '..._cpp.mexa64': /usr/lib/libgdal.so.1: undefined symbol: _ZN11xercesc_3_111InputSource11setEncodingEPKt
Component: Simulink | Category: Block error
So I thought at first it was a linking problem, which is when I found this solution https://www.mathworks.com/matlabcentral/newsreader/view_thread/336245 that told me to set a symbolic link to a library libproj.so.0, but that didnt work. I think the problem might be within how I defined my "mdlInitializeSizes" function within the mex file but I have no clues to where and why.
I am very new to using Mex functions, so I apologize if this is a simple answer. I have been scouring the Internet trying find a solution to this problem by looking at various Matlab Answer questions, and the best question that I thought would answer my question was in https://www.mathworks.com/matlabcentral/answers/194923-sumo-returns-error-using-system-command-on-a-linux-machine-while-it-works-properly-inside-termina. If anyone has any clues or thoughts please comment or leave an answer :).
Thanks
Answers (0)
Categories
Find more on Library Domains in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!