Using SWIG with methods that take std::string as a parameter

前端 未结 1 1957
忘掉有多难
忘掉有多难 2021-02-12 22:40

I used SWIG to wrap my c++ class. Some methods have a const std::string& as a parameter. SWIG creates a type called SWIGTYPE_p_std__string however

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-12 23:25

    I was trying to solve this myself when I found your question.

    You need to include

    %include "std_string.i" 
    

    in your .i file. See:

    • STL/C++ library

      for more details.

    0 讨论(0)
提交回复
热议问题