1

I am struggling to figure this out and getting a large volume of boost errors when trying to convert my c++ class "Car" into a python module

Code from Car.h

#ifndef Carproj_CAR_H
#define Carproj_CAR_H
#include <string>


class Car {

public:
    Car(std::string & name, int & speed);
    void drive();

    void increaseSpeed();
private:
    std::string m_name;
    int m_speed;

};

Code from Car.cpp 

#include "Car.h"
#include <string>
#include <iostream>
#include <boost/python.hpp>
using namespace boost::python;




Car::Car(std::string & name, int & speed) {
    m_name = name;
    m_speed = speed;
}
void Car::drive() {

    std::cout << "Driving" << std::endl;
}

void Car::increaseSpeed() {

    m_speed+=30;

}


BOOST_PYTHON_MODULE(Car)
                {
                 class_<Car>("Car",init<std::string, int>())
                               .def("drive",&Car::drive).def("increaseSpeed",&Car::increaseSpeed);
                }

Errors receiving - whole message :)

In file included from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:57:0,
                 from /usr/include/boost/python/object/value_holder.hpp:50,
                 from /usr/include/boost/python/object/class_metadata.hpp:11,
                 from /usr/include/boost/python/class.hpp:23,
                 from /usr/include/boost/python.hpp:18,
                 from /home/damian/CLionProjects/Carproj/Car.cpp:8:
/usr/include/boost/python/object/value_holder.hpp: In instantiation of ‘boost::python::objects::value_holder<Value>::value_holder(PyObject*, A0, A1) [with A0 = boost::python::objects::reference_to_value<std::__cxx11::basic_string<char> >; A1 = int; Value = Car; PyObject = _object]’:
/usr/include/boost/python/object/make_holder.hpp:94:17:   required from ‘static void boost::python::objects::make_holder<2>::apply<Holder, ArgList>::execute(PyObject*, boost::python::objects::make_holder<2>::apply<Holder, ArgList>::t0, boost::python::objects::make_holder<2>::apply<Holder, ArgList>::t1) [with Holder = boost::python::objects::value_holder<Car>; ArgList = boost::mpl::vector2<std::__cxx11::basic_string<char>, int>; PyObject = _object; boost::python::objects::make_holder<2>::apply<Holder, ArgList>::t0 = std::__cxx11::basic_string<char>; boost::python::objects::make_holder<2>::apply<Holder, ArgList>::t1 = int]’
/usr/include/boost/python/detail/make_keyword_range_fn.hpp:63:47:   required from ‘boost::python::api::object boost::python::detail::make_keyword_range_constructor(const CallPolicies&, const keyword_range&, Holder*, ArgList*, Arity*) [with ArgList = boost::mpl::vector2<std::__cxx11::basic_string<char>, int>; Arity = boost::mpl::size<boost::mpl::vector2<std::__cxx11::basic_string<char>, int> >; Holder = boost::python::objects::value_holder<Car>; CallPolicies = boost::python::default_call_policies; boost::python::detail::keyword_range = std::pair<const boost::python::detail::keyword*, const boost::python::detail::keyword*>]’
/usr/include/boost/python/init.hpp:332:66:   required from ‘void boost::python::detail::def_init_aux(ClassT&, const Signature&, NArgs, const CallPoliciesT&, const char*, const keyword_range&) [with ClassT = boost::python::class_<Car>; CallPoliciesT = boost::python::default_call_policies; Signature = boost::mpl::vector2<std::__cxx11::basic_string<char>, int>; NArgs = boost::mpl::size<boost::mpl::vector2<std::__cxx11::basic_string<char>, int> >; boost::python::detail::keyword_range = std::pair<const boost::python::detail::keyword*, const boost::python::detail::keyword*>]’
/usr/include/boost/python/init.hpp:399:31:   required from ‘static void boost::python::detail::define_class_init_helper<0>::apply(ClassT&, const CallPoliciesT&, const Signature&, NArgs, const char*, const keyword_range&) [with ClassT = boost::python::class_<Car>; CallPoliciesT = boost::python::default_call_policies; Signature = boost::mpl::vector2<std::__cxx11::basic_string<char>, int>; NArgs = boost::mpl::size<boost::mpl::vector2<std::__cxx11::basic_string<char>, int> >; boost::python::detail::keyword_range = std::pair<const boost::python::detail::keyword*, const boost::python::detail::keyword*>]’
/usr/include/boost/python/init.hpp:171:67:   required from ‘void boost::python::init_base<DerivedT>::visit(classT&) const [with classT = boost::python::class_<Car>; DerivedT = boost::python::init<std::__cxx11::basic_string<char>, int>]’
/usr/include/boost/python/def_visitor.hpp:31:9:   required from ‘static void boost::python::def_visitor_access::visit(const V&, classT&) [with V = boost::python::def_visitor<boost::python::init<std::__cxx11::basic_string<char>, int> >; classT = boost::python::class_<Car>]’
/usr/include/boost/python/def_visitor.hpp:67:34:   required from ‘void boost::python::def_visitor<DerivedVisitor>::visit(classT&) const [with classT = boost::python::class_<Car>; DerivedVisitor = boost::python::init<std::__cxx11::basic_string<char>, int>]’
/usr/include/boost/python/class.hpp:226:9:   required from ‘boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const boost::python::def_visitor<Derived>&) [with Derived = boost::python::init<std::__cxx11::basic_string<char>, int>; W = Car; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified; boost::python::class_<T, X1, X2, X3>::self = boost::python::class_<Car>]’
/usr/include/boost/python/class.hpp:502:9:   required from ‘void boost::python::class_<T, X1, X2, X3>::initialize(const DefVisitor&) [with DefVisitor = boost::python::init_base<boost::python::init<std::__cxx11::basic_string<char>, int> >; W = Car; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/usr/include/boost/python/class.hpp:209:9:   required from ‘boost::python::class_<T, X1, X2, X3>::class_(const char*, const boost::python::init_base<DerivedT>&) [with DerivedT = boost::python::init<std::__cxx11::basic_string<char>, int>; W = Car; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/home/damian/CLionProjects/Carproj/Car.cpp:31:57:   required from here
/usr/include/boost/python/object/value_holder.hpp:137:13: error: binding ‘const std::__cxx11::basic_string<char>’ to reference of type ‘std::__cxx11::string& {aka std::__cxx11::basic_string<char>&}’ discards qualifiers
             BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil)
             ^
/home/damian/CLionProjects/Carproj/Car.cpp:14:1: note:   initializing argument 1 of ‘Car::Car(std::__cxx11::string&, int&)’
 Car::Car(std::string & name, int & speed) {
 ^
CMakeFiles/untitled1.dir/build.make:86: recipe for target 'CMakeFiles/untitled1.dir/Car.cpp.o' failed
make[3]: *** [CMakeFiles/untitled1.dir/Car.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/untitled1.dir/all' failed
make[2]: *** [CMakeFiles/untitled1.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/untitled1.dir/rule' failed
make[1]: *** [CMakeFiles/untitled1.dir/rule] Error 2
Makefile:118: recipe for target 'untitled1' failed
make: *** [untitled1] Error 2

Using cmake --build /home/damian/CLionProjects/Carproj/cmake-build-debug --target untitled1 -- -j 2 to build

Any help greatly appreciated

---- new ----

following from WinClouds suggestion new errors again, baffling me:(

Scanning dependencies of target untitled1
[ 33%] Building CXX object CMakeFiles/untitled1.dir/Car.cpp.o
[ 66%] Linking CXX executable untitled1
CMakeFiles/untitled1.dir/Car.cpp.o: In function `initCar':
/home/damian/CLionProjects/Carproj/Car.cpp:29: undefined reference to `boost::python::detail::init_module(char const*, void (*)())'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::type_info::name() const':
/usr/include/boost/python/type_id.hpp:165: undefined reference to `boost::python::detail::gcc_demangle(char const*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::detail::none()':
/usr/include/boost/python/detail/none.hpp:16: undefined reference to `_Py_NoneStruct'
/usr/include/boost/python/detail/none.hpp:16: undefined reference to `_Py_NoneStruct'
/usr/include/boost/python/detail/none.hpp:16: undefined reference to `_Py_NoneStruct'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::api::object::object()':
/usr/include/boost/python/object_core.hpp:504: undefined reference to `_Py_NoneStruct'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `_object* boost::python::expect_non_null<_object>(_object*)':
/usr/include/boost/python/errors.hpp:45: undefined reference to `boost::python::throw_error_already_set()'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::class_<Car, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified>::class_<boost::python::init<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> >(char const*, boost::python::init_base<boost::python::init<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > const&)':
/usr/include/boost/python/class.hpp:207: undefined reference to `boost::python::objects::class_base::class_base(char const*, unsigned long, boost::python::type_info const*, char const*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `void boost::python::class_<Car, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified>::initialize<boost::python::init_base<boost::python::init<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > >(boost::python::init_base<boost::python::init<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_, mpl_::void_> > const&)':
/usr/include/boost/python/class.hpp:500: undefined reference to `boost::python::objects::class_base::set_instance_size(unsigned long)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `void boost::python::class_<Car, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified>::def_impl<Car, void (Car::*)(), boost::python::detail::def_helper<char const*, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified> >(Car*, char const*, void (Car::*)(), boost::python::detail::def_helper<char const*, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified> const&, ...)':
/usr/include/boost/python/class.hpp:537: undefined reference to `boost::python::objects::add_to_namespace(boost::python::api::object const&, char const*, boost::python::api::object const&, char const*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::api::object boost::python::detail::make_function_aux<void (Car::*)(), boost::python::default_call_policies, boost::mpl::vector2<void, Car&>, mpl_::int_<0> >(void (Car::*)(), boost::python::default_call_policies const&, boost::mpl::vector2<void, Car&> const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&, mpl_::int_<0>)':
/usr/include/boost/python/make_function.hpp:62: undefined reference to `boost::python::objects::function_object(boost::python::objects::py_function const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `void boost::python::objects::class_metadata<Car, boost::python::detail::not_specified, boost::python::detail::not_specified, boost::python::detail::not_specified>::maybe_register_class_to_python<Car>(Car*, mpl_::bool_<false>)':
/usr/include/boost/python/object/class_metadata.hpp:275: undefined reference to `boost::python::objects::copy_class_object(boost::python::type_info const&, boost::python::type_info const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::py_function_impl_base::py_function_impl_base()':
/usr/include/boost/python/object/py_function.hpp:20: undefined reference to `vtable for boost::python::objects::py_function_impl_base'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::shared_ptr_from_python<Car>::shared_ptr_from_python()':
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:25: undefined reference to `boost::python::converter::registry::insert(void* (*)(_object*), void (*)(_object*, boost::python::converter::rvalue_from_python_stage1_data*), boost::python::type_info, _typeobject const* (*)())'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `void boost::python::objects::register_dynamic_id<Car>(Car*)':
/usr/include/boost/python/object/inheritance.hpp:73: undefined reference to `boost::python::objects::register_dynamic_id_aux(boost::python::type_info, std::pair<void*, boost::python::type_info> (*)(void*))'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::to_python_converter<Car, boost::python::objects::class_cref_wrapper<Car, boost::python::objects::make_instance<Car, boost::python::objects::value_holder<Car> > >, true>::to_python_converter()':
/usr/include/boost/python/to_python_converter.hpp:87: undefined reference to `boost::python::converter::registry::insert(_object* (*)(void const*), boost::python::type_info, _typeobject const* (*)())'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::shared_ptr_from_python<Car>::convertible(_object*)':
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:35: undefined reference to `_Py_NoneStruct'
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:38: undefined reference to `boost::python::converter::get_lvalue_from_python(_object*, boost::python::converter::registration const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::shared_ptr_from_python<Car>::construct(_object*, boost::python::converter::rvalue_from_python_stage1_data*)':
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:50: undefined reference to `boost::python::converter::shared_ptr_deleter::shared_ptr_deleter(boost::python::handle<_object>)'
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:50: undefined reference to `boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter()'
/usr/include/boost/python/converter/shared_ptr_from_python.hpp:58: undefined reference to `boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter()'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_from_python_type_direct<Car>::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:104: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::shared_ptr<void>::shared_ptr<void, boost::python::converter::shared_ptr_deleter>(void*, boost::python::converter::shared_ptr_deleter)':
/usr/include/boost/smart_ptr/shared_ptr.hpp:358: undefined reference to `boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter()'
/usr/include/boost/smart_ptr/shared_ptr.hpp:358: undefined reference to `boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter()'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::registration const& boost::python::converter::detail::registry_lookup2<Car const volatile>(Car const volatile& (*)())':
/usr/include/boost/python/converter/registered.hpp:87: undefined reference to `boost::python::converter::registry::lookup(boost::python::type_info)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::detail::shared_count::shared_count<void*, boost::python::converter::shared_ptr_deleter>(void*, boost::python::converter::shared_ptr_deleter)':
/usr/include/boost/smart_ptr/detail/shared_count.hpp:171: undefined reference to `boost::python::converter::shared_ptr_deleter::operator()(void const*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `_object* boost::python::objects::make_instance_impl<Car, boost::python::objects::value_holder<Car>, boost::python::objects::make_instance<Car, boost::python::objects::value_holder<Car> > >::execute<boost::reference_wrapper<Car const> const>(boost::reference_wrapper<Car const> const&)':
/usr/include/boost/python/object/make_instance.hpp:45: undefined reference to `boost::python::instance_holder::install(_object*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::make_holder<2>::apply<boost::python::objects::value_holder<Car>, boost::mpl::vector2<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> >::execute(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
/usr/include/boost/python/object/make_holder.hpp:92: undefined reference to `boost::python::instance_holder::allocate(_object*, unsigned long, unsigned long)'
/usr/include/boost/python/object/make_holder.hpp:94: undefined reference to `boost::python::instance_holder::install(_object*)'
/usr/include/boost/python/object/make_holder.hpp:98: undefined reference to `boost::python::instance_holder::deallocate(_object*, void*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `_typeobject* boost::python::objects::make_instance<Car, boost::python::objects::value_holder<Car> >::get_class_object<boost::reference_wrapper<Car const> const>(boost::reference_wrapper<Car const> const&)':
/usr/include/boost/python/object/make_instance.hpp:66: undefined reference to `boost::python::converter::registration::get_class_object() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::value_holder<Car>::value_holder<boost::python::objects::reference_to_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>(_object*, boost::python::objects::reference_to_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int)':
/usr/include/boost/python/object/value_holder.hpp:137: undefined 
/usr/include/boost/python/object_core.hpp:213: undefined reference to `boost::python::objects::add_to_namespace(boost::python::api::object const&, char const*, boost::python::api::object const&, char const*)'
CMakeFiles/untitled1.dir/Car.cpp.o:(.rodata._ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvP7_objectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiENS0_21default_call_policiesENS_3mpl7vector4IvS6_SC_iEEEEEE[_ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvP7_objectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiENS0_21default_call_policiesENS_3mpl7vector4IvS6_SC_iEEEEEE]+0x30): undefined reference to `boost::python::objects::py_function_impl_base::max_arity() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (*)(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int), boost::python::default_call_policies, boost::mpl::vector4<void, _object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> > >::~caller_py_function_impl()':
/usr/include/boost/python/object/py_function.hpp:30: undefined reference to `boost::python::objects::py_function_impl_base::~py_function_impl_base()'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::detail::sp_counted_impl_pd<void*, boost::python::converter::shared_ptr_deleter>::~sp_counted_impl_pd()':
/usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:127: undefined reference to `boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter()'
CMakeFiles/untitled1.dir/Car.cpp.o:(.rodata._ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM3CarFvvENS0_21default_call_policiesENS_3mpl7vector2IvRS5_EEEEEE[_ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM3CarFvvENS0_21default_call_policiesENS_3mpl7vector2IvRS5_EEEEEE]+0x30): undefined reference to `boost::python::objects::py_function_impl_base::max_arity() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (Car::*)(), boost::python::default_call_policies, boost::mpl::vector2<void, Car&> > >::~caller_py_function_impl()':
/usr/include/boost/python/object/py_function.hpp:30: undefined reference to `boost::python::objects::py_function_impl_base::~py_function_impl_base()'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::value_holder<Car>::~value_holder()':
/usr/include/boost/python/object/value_holder.hpp:43: undefined reference to `boost::python::instance_holder::~instance_holder()'
CMakeFiles/untitled1.dir/Car.cpp.o:(.rodata._ZTIN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvP7_objectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiENS0_21default_call_policiesENS_3mpl7vector4IvS6_SC_iEEEEEE[_ZTIN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvP7_objectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiENS0_21default_call_policiesENS_3mpl7vector4IvS6_SC_iEEEEEE]+0x10): undefined reference to `typeinfo for boost::python::objects::py_function_impl_base'
CMakeFiles/untitled1.dir/Car.cpp.o:(.rodata._ZTIN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM3CarFvvENS0_21default_call_policiesENS_3mpl7vector2IvRS5_EEEEEE[_ZTIN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM3CarFvvENS0_21default_call_policiesENS_3mpl7vector2IvRS5_EEEEEE]+0x10): undefined reference to `typeinfo for boost::python::objects::py_function_impl_base'
CMakeFiles/untitled1.dir/Car.cpp.o:(.rodata._ZTIN5boost6python7objects12value_holderI3CarEE[_ZTIN5boost6python7objects12value_holderI3CarEE]+0x10): undefined reference to `typeinfo for boost::python::instance_holder'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::detail::sp_counted_impl_pd<void*, boost::python::converter::shared_ptr_deleter>::dispose()':
/usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:153: undefined reference to `boost::python::converter::shared_ptr_deleter::operator()(void const*)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::objects::value_holder<Car>::holds(boost::python::type_info, bool)':
/usr/include/boost/python/object/value_holder.hpp:96: undefined reference to `boost::python::objects::find_static_type(void*, boost::python::type_info, boost::python::type_info)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::arg_rvalue_from_python<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::arg_rvalue_from_python(_object*)':
/usr/include/boost/python/converter/arg_from_python.hpp:299: undefined reference to `boost::python::converter::rvalue_from_python_stage1(_object*, boost::python::converter::registration const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::arg_rvalue_from_python<int>::arg_rvalue_from_python(_object*)':
/usr/include/boost/python/converter/arg_from_python.hpp:299: undefined reference to `boost::python::converter::rvalue_from_python_stage1(_object*, boost::python::converter::registration const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_pytype_for_arg<void>::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_pytype_for_arg<_object*>::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_pytype_for_arg<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_pytype_for_arg<int>::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::reference_arg_from_python<Car&>::reference_arg_from_python(_object*)':
/usr/include/boost/python/converter/arg_from_python.hpp:283: undefined reference to `boost::python::converter::get_lvalue_from_python(_object*, boost::python::converter::registration const&)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::expected_pytype_for_arg<Car&>::get_pytype()':
/usr/include/boost/python/converter/pytype_function.hpp:68: undefined reference to `boost::python::converter::registry::query(boost::python::type_info)'
/usr/include/boost/python/converter/pytype_function.hpp:69: undefined reference to `boost::python::converter::registration::expected_from_python_type() const'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::registration const& boost::python::converter::detail::registry_lookup2<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const volatile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const volatile& (*)())':
/usr/include/boost/python/converter/registered.hpp:87: undefined reference to `boost::python::converter::registry::lookup(boost::python::type_info)'
CMakeFiles/untitled1.dir/Car.cpp.o: In function `boost::python::converter::registration const& boost::python::converter::detail::registry_lookup2<int const volatile>(int const volatile& (*)())':
/usr/include/boost/python/converter/registered.hpp:87: undefined reference to `boost::python::converter::registry::lookup(boost::python::type_info)'
collect2: error: ld returned 1 exit status
CMakeFiles/untitled1.dir/build.make:120: recipe for target 'untitled1' failed
make[3]: *** [untitled1] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/untitled1.dir/all' failed
make[2]: *** [CMakeFiles/untitled1.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/untitled1.dir/rule' failed
make[1]: *** [CMakeFiles/untitled1.dir/rule] Error 2
Makefile:118: recipe for target 'untitled1' failed
make: *** [untitled1] Error 2

If anyone knows of any material as I am completely new to Boost Python this would be useful as this over stream of error messages is mind boggling

Damian

4
  • Hi ! It would be better if you checkout POST Format for future endeavor at Stack overflow. -Thank you Commented Apr 18, 2018 at 9:59
  • Please add the full error message, for the moment only the references were printed and the real error the compiler is complaining about is missing. Commented Apr 18, 2018 at 12:45
  • The best would be to fullr remove the references to the arguments in constructor like this: Car(const std::string name, int speed). References for int does not make sense here, because the reference is as big as int itself and has no advantage, std::string does referencing internally in most implementations so this is also no additional cost. Commented Apr 19, 2018 at 11:14
  • Ok that makes sense, however it doesn't seem to remove the errors? Commented Apr 19, 2018 at 12:59

1 Answer 1

1

Constuctor of Class Car's params need a non-const referece, so It only accept left-value.

But the Python exported class template is a temporary value, It is a right-value and can not be the constuctor's argument.

So, You can change param of Car's constuctor param to const reference. Like this:

Car(const std::string & name, const int & speed);
Sign up to request clarification or add additional context in comments.

1 Comment

Hi WinCloud, I don't really get what you mean. Why would making it a const reference help in this situation. The exported class template requires the arguments that I have specified, is this down to the interpretation of boost python. Also I have changed this with your advice and getting similar errors added to the description above. Thank you for helping

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.