Problem with Simulink coder including matrix.h in a C S-function
8 views (last 30 days)
Show older comments
Hello everyone,
I am trying to develop a zeromq implementation in a Simulink model and later on generate code. However, my problem is not about zmq library, in stead, I am getting troubles in previous steps. I have replicated the error removing everything related to zeromq.
It is about mxArrayToString function from the matrix.h library. The point is there is no problem when I mex the file getAddressFromMask.cpp, indeed, if you run the model model_example.slx, it works fine and a debug operations with Visual Studio shows that getting parameter is going great.

The problem came when I tried to build the model, where pop-up the next error:
C:\ERROR_~1\getAddressFromMask.cpp(113): error C3861: 'mxArrayToString': identifier not found
Full trace is in the file errorlog_without_matrixHeader.txt
At first, I thought that the problem was related to the headers files included by simstruct.h as it is exposed in: https://es.mathworks.com/help/simulink/sfg/templates-for-c-s-functions.html
So I tried to include the header <matrix.h> manually in getAddressFromMask.cpp. However, once I tried to build the model, several errors pop-up, and it seems due to incompatibility between matrix.h and rt_matrx.h (full trace in errorlog_including_matrixHeader.txt)
I am using Matlab 2018b and Visual Studio 2017 to mex files.
Can anyone please help me with this?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!