[C++-sig] Trouble with Py++/boost.python

Stefan Seefeld seefeld at sympatico.ca
Mon Jan 29 19:55:04 CET 2007


Robert,

the 'semantic error message' is cleverly encoded into the error message
you get from the compiler. For example:

Robert O'Callahan wrote:

>     boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<FILE*>,

(just read that out aloud.)

What that means is at some point you try to wrap a function returning a pointer
('FILE *', it seems), and boost.python does not know how to handle that, i.e. whether you
want the underlying FILE object to be owned by the newly created wrapper, or not.
Thus, you have to provide a 'return_value_policy', as documented here:
http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies

HTH,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list