c++ - Mex runtime error: Unexpected standard expression -


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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -