python - Problem with number/type of arguments passed to an overloaded c++ constructor wrapped with swig -


i trying wrap c++ class (let's call "spam") written else swig expose python. after solving several problems, able import module in python, when try create object of such class obtain following error:

 foo = spam.spam('abc',3) traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "spam.py", line 96, in __init__     = _spam.new_spam(*args) notimplementederror: wrong number of arguments overloaded function 'new_spam'.   possible c/c++ prototypes are:     spam(unsigned char *,unsigned long,bool,unsigned int,sstree::io_action,char const *)     spam(unsigned char *,unsigned long,bool,unsigned int,sstree::io_action)     spam(unsigned char *,unsigned long,bool,unsigned int)     spam(unsigned char *,unsigned long,bool)     spam(unsigned char *,unsigned long) 

googling around, realized error caused type of arguments , not number (which quite confusing), still cannot identify. suspect problem lies in passing string first argument, have no idea on how fix (keep in mind know no c/c++).

try with:

%typemap(in) (unsigned char *) = (char *); 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -