swig Nothing known about base class 'std::string', ignored

后端 未结 2 1177
眼角桃花
眼角桃花 2021-01-18 22:11

I am trying to use swig to build ruby wrappers around a c++ library. Most of it seems to be working but I have one issue that I am pretty sure is related to the above warnin

2条回答
  •  [愿得一人]
    2021-01-18 23:04

    Whenever you see SWIG::Type_p_std__string or similar cryptic type in SWIG output, it means there is a typemap missing. Here, SWIG needs to export std::string. Normally this is because it is used in a function call parameter or as a return value in a function you are exporting; in your case, it is because std::string is a base class. SWIG includes a "library" of typemaps for commonly used STL classes such as string and vector, you simply import it via an %include directive. See http://www.swig.org/Doc2.0/Library.html for other .i that are included with SWIG.

提交回复
热议问题