Hi.
I have a Qt app that uses another library where the function output is std::string instead of a QString.
So in my program I have a method
void doSomething() {
...
std::string std_string = MyExternalLibraryThatReturnsSTLstring.getString();
QString myQString = QString::fromStdString(std_string);
...
process(myQString);
...
}
When my external lib returns a not-empty std::string everything works fine. But when an empty std::string is returned, the app crashes at the end of the scope. I guessed that has to do with destruction of the std::string object(?).
The conversion to QString works fine, even with an empty std::string.
Can someone tell my why this happens, and how to avoid this run-time error?
(In other threads some people have discussed mixing of debug and release libraries, but I dont think that I have done that. How to find out btw?)