C++ S-function in Real-Time Windows Target

1 view (last 30 days)
Ruben Marti
Ruben Marti on 13 Jan 2014
Commented: Kevin Cheng on 19 Aug 2020
Hello to all,
I have written a C++ S-function to be used on HIL. To test it firts, I have used the counter C++ S-function example (sfcndemo_counter_cpp).
It works and compile to Real-Time Windows Target properly, but when I want to connect to target (RT Windows target) the following erros appears:
Error occurred while executing External Mode MEX-file 'rtwinext': Error loading real-time executable: undefined symbol "_Znwy"
Does Real-Time Windows target work with C++ S-function?
I am using Matlab R2013b, Windws 7 64-bits.
Thank you in advance
  2 Comments
vamsi
vamsi on 10 Aug 2015
Hello Ruben Marti,
I am also struggling with the same problem. Did you find any workaround for the problem??
Thanks, Vamsi.
Kevin Cheng
Kevin Cheng on 19 Aug 2020
The problem is in line 131 and 187 of sfun_counter_cpp.cpp - the new/delete commands are not supported in real-time code generation. You will need to replace those with malloc/free.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!