[C++-sig] No to_python (by-value) converter found for C++ type

vishal bayskar vishal.bayskar at nechclst.in
Tue May 25 06:03:32 CEST 2010


I am facing a problem while creating python binding for some code in my
application.
I have created a sample program for that and attached the same to this mail.

Here after the generation of python bindings when I try to use that it fails
with error

No to_python (by-value) converter found for C++ type: CallResult<Simple>

Where as for this example code it even does not shows warning that
CallResult<Simple> is unknown type, still I used
sizeof  and even in the generated code I could find CallResult<Simple>
class.

Attached tar file contains:

structEx.cpp (cpp code)
ex.py (python code generator script)
exWithSizeOf.py (python code generator script using size of)
sizeof.h
include.h
t.py(example python script to use the generated binding )

g++ -fpic -shared -o testModule.so  -I/usr/include/python2.4/ -L/usr/lib64/
-lboost_python testModule.cpp  (command for compilation)

Can you please suggest what I am missing in this case.


After some analysis I found, in my case python bindings generated contains
line:
typedef bp::class_< CallResult< Simple >, boost::noncopyable >
CallResult_less__Simple__greater__exposer_t;
I could not understand why boost::noncopyable is added as an extra template
parameter and this seems to be be
culprit in my case.
I don't think my class contains object of any class which is derived from
boost::noncopyable.

Can you please suggest, what I am missing in this case?
http://old.nabble.com/file/p28664090/structEx.tar.gz structEx.tar.gz 

-- 
View this message in context: http://old.nabble.com/No-to_python-%28by-value%29-converter-found-for-C%2B%2B-type-tp28664090p28664090.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.



More information about the Cplusplus-sig mailing list