I have a C++ class with a string as (protected) member. I have to set the string and output it. That works perfectly when I stay in C++ and don’t try to include this in a Max5 external.
However, when I try to encapsulate my C++ code in the C Max API, any operation on the string makes Max5 crash.
When I change my C++ string member for a char* member (C-like), then, everything works.
I can’t figure out why this is happening ?
Is there some confusion between the library provided for C and the C++ class ?
Is it especially forbidden (or unsupported) to use C++ string with the Max5 API ?
I am doing it wrong ?
If you think of any pointers to help me understand what’s going on, I would appreciate…
For now, I will stick with a char* member to have something working. But I would prefer to make it cleaner and use a string when in C++ and a char* when in C.
Thank’s for your answer !
I think you’re probably right about the cause of the problem. And I’ll will try the option 1) you suggested.
The other options won’t work for me however because my externals are actually in C. Only the data structure (and the manipulating of it) is in C++. The Max API remains in C and only serve as a framework to use the data structure through Max.