c++ - Mex runtime error: Unexpected standard expression -
this question has answer here:
i new mex. after building c++ mex file, error @ runtime.
>> [a b c] = read_svm('/all/testhalf_anger_1.libsvm'); unexpected standard exception mex file. what() is:basic_string::_s_construct null not valid .. this execution of code looks
thank in advance!
the error message explains well, somewhere in code you're constructing basic_string passing null pointer constructor. basic_string constructor takes chart * requires pointer non-null, hence crash.
note std::string , std::wstring typedefs std::basic_string class template, may using 1 of these in code.
you can fix doing similar following snippet
char const *p = nullptr; // std::string s(p); // not allowed! std::string s( p ? p : "" ); // string empty if p null
Comments
Post a Comment