173 questions
0 votes
1 answer
307 views
How to package SWIG with a library
I am using SWIG to generate wrappers for my code which makes SWIG as a direct dependency. I want to package it as part of the library code and build it prior to compilation of my source code. How ...
0 votes
1 answer
106 views
Swig and C#: cannot assign value to struct array member
The C++ struct has one fixed 2d char array as member typedef struct ReqSubscribeField { char routing_key[100][56]; }ReqSubscribeField_t; and I used Swig to generate the following C# class ...
0 votes
1 answer
107 views
SWIG: How to pass a vector of complex numbers from C++ to Java
%include <std_complex.i> manager.i:21: Error: Unable to find 'std_complex.i'
0 votes
1 answer
729 views
Swig undefined symbol when function is inside the class
so for my job I am using swig to pass an array through SWIG from a python file to a c++ file. I can get it to work, but not if it is inside a class. I am new to SWIG and I found the implementation ...
0 votes
0 answers
309 views
Swig error: member function already defined or declared
I'm pretty much a swig novice so I hope that the problem I'm running into is a basic one. My problem is that I can't seem to get swig to compile an unordered_map. Here's a MWE. Note that I eventually ...
3 votes
1 answer
580 views
Changing return type in generated CS function using SWIG
I am trying to generate wrappers in C# for C++ library and using generated C3 wrappers I am developing client application. C++ class: namespace ns { class ISampleInterface { public: ...
2 votes
1 answer
3k views
proxy of <Swig Object of type 'std::map< char,int >
Calling the below code from python: from f_p import form_p print(form_p([1,2,3])) Gives me below error Error: (<f_p.mapiv; proxy of <Swig Object of type 'std::map< char,int > *' at ...
0 votes
1 answer
180 views
Way to Convert Python2 Unicode to std::string with swig
#define SWIG_PYTHON_2_UNICODE is notworking in python2,this is the file .i,PyUnicode_FromString can map std string to unicode %include <std_pair.i> %include <std_vector.i> %include <...
0 votes
1 answer
64 views
The result of swig running in C++ is different from that in python
void BK::BKTree::recursiveSearchNew(BK::Node *node, std::vector<std::pair<std::string, int> > *r, string w, size_t t) { size_t curDist = levenshteinDistance(...
1 vote
0 answers
150 views
defining map<int, vector<int> > return type gives random values on every run
After building and calling it using python main.py it gives me result like this: [array([22209328, 21870, 0], dtype=int32), array([24088960, 21870, 1], dtype=int32)] Why ...
0 votes
1 answer
1k views
How to access field names of javascript object in HTML passed in from backend?
Example: var obj={name:bob, } I want to access not the value of name i.e. bob instead an array containing keys of obj like [name]. <h1>{{ pagename|title }}</h1> <ul> {% for ...
1 vote
2 answers
91 views
How to concate two string on Swig?
I am trying to concate a variable with another string but failed to do so. Till now i tried these things but failed. {{name~' Leon'}} and {{name+' Leon'}} remember i am trying to do it in swig not in ...
0 votes
1 answer
1k views
how can I use C struct pointers in python using swig?
I have a pointer to a C structure and i need know how i can initialize the struct from python after generating the python library using swig. I was able to compile the code and run swig without any ...
1 vote
1 answer
102 views
Use of dot inside brackets is breaking the swig template
Use of Dot inside curly brackets is breaking the rendering of swig template. I am not sure if its a bug. I have the code like this some where in between html text for a article: <pre> <...
1 vote
1 answer
517 views
Node.js SWIG is it support Async function?
I have dynamic html page what using Node.js and SWIG template engine. I need call function from my SWIG template to get user data from database to render page content. SWIG call function but not wait ...