How to expose std::vector as a Python list using SWIG?

前端 未结 2 1795
既然无缘
既然无缘 2020-12-09 17:15

I\'m trying to expose this function to Python using SWIG:

std::vector get_match_stats();

And I want SWIG to generate wrapping co

相关标签:
2条回答
  • 2020-12-09 17:52
    %template(IntVector) vector<int>;
    
    0 讨论(0)
  • 2020-12-09 18:03

    I don't have much experience with Swig, but are you #including your C++ header file in your .i file? Try one (or both) of

    %include "myvector.h"
    
    
    %{
    #   include "myvector.h"
    %}
    
    0 讨论(0)
提交回复
热议问题