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

后端 未结 2 1212
眼角桃花
眼角桃花 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 22:56

    SWIG is complaining that it doesn't know about the the std::string class and so cannot generate code for it.

    The SWIG library std_string.i has language specific code for mapping the c++ string to the target languages string class. Adding %include "std_string.i" before the code that generates your class should fix the error.

    Note that %include is different from #include in a swig interface file.

提交回复
热议问题