On Thu, Feb 4, 2016 at 7:41 PM, Daniel Burchardt
<[email protected]> wrote:
> Hi,
>
> I try create v8 module to python used boost and i have problem:
>
> #include <iostream>
>
> using namespace std;
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include "include/libplatform/libplatform.h"
> #include "include/v8.h"
>
> using namespace v8;
>
> const char* say_hello(const char* name) {
>     return name;
> }
>
> #include <boost/python/module.hpp>
> #include <boost/python/def.hpp>
>
> using namespace boost::python;
>
> BOOST_PYTHON_MODULE(hello)
> {
>     class_<V8>("V8");
>
>     def("say_hello", say_hello);
> }
>
> In compile process i have error:
> hellomodule.cpp: In function ‘void init_module_hello()’:
> hellomodule.cpp:24:14: error: wrong number of template arguments (1, should
> be 4)
>      class_<V8>("V8");
>
>
> Thanks for help

You need to include boost/python/class.hpp as well.  That alone is not
enough: class V8 cannot be instantiated (it doesn't have a public
constructor) so you need to pass boost::python::no_init as a template
parameter to boost::python::clazz_.

Aside, your post is pretty off-topic for v8-users; it's basically all
about boost::python, none of it is specific to V8.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to