I encounted an linking error while outputing a TextPacket from a device that I am creating. The error message said that void TextPacket::setText(const char *txt) is an undefined reference. I wonder if it’s because the library file wasn’t included in the PDK or if the function is not defined yet.
I’ve temporarily bypassed this problem by defining my own inline function in the TextPacket.h to overide the default setText.
inline void TextPacket::setText(const std::string& txt)
int len = txt.length();
body = new char[len+1];
memcpy(body, txt.c_str(), len);
body[len] = NULL;
However, I could not get the “Text Output” device (which is hooked to the text output of my device) to write a file to the disk. There is no error or warning, just that the “Write output to disk” didn’t do anything. Also, after the device is built, it will result an exception whenever I want to switch to either the “Layout view” or the “Explorer view”. The device behaves fine if I just swith between the other views.
I wonder if I missed anything here. I would really appreciate your help if you’ve had similar experience. Thank you!