0
私の目標は、私のPythonコード用のマルチスレッドC++ DLLを書くことです。 Pythonコードの機能は、PCLを使用してポイントクラウドを処理するためにC++ライブラリを呼び出すことですが、C++ライブラリは自動的に新しいスレッドを生成してポイントクラウドを視覚化します。 私のboost.pyモジュールは、私のC++ライブラリにboost.threadを組み込むまで正常に動作します。私が得るコンパイルエラーは以下の通りです。boost.pythonとboost.threadの両方を使用するとコンパイルエラー
In file included from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52: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/boooooosh/QuickAccess/Depowdering/blackbox/src/blackbox_skeleton/central_processor.cpp:8:
/usr/include/boost/python/object/value_holder.hpp: In instantiation of ‘boost::python::objects::value_holder<Value>::value_holder(PyObject*, A0) [with A0 = boost::reference_wrapper<const BlackboxProcessor>; Value = BlackboxProcessor; PyObject = _object]’:
/usr/include/boost/python/object/make_instance.hpp:71:48: required from ‘static Holder* boost::python::objects::make_instance<T, Holder>::construct(void*, PyObject*, boost::reference_wrapper<const T>) [with T = BlackboxProcessor; Holder = boost::python::objects::value_holder<BlackboxProcessor>; PyObject = _object]’
/usr/include/boost/python/object/make_instance.hpp:45:74: required from ‘static PyObject* boost::python::objects::make_instance_impl<T, Holder, Derived>::execute(Arg&) [with Arg = const boost::reference_wrapper<const BlackboxProcessor>; T = BlackboxProcessor; Holder = boost::python::objects::value_holder<BlackboxProcessor>; Derived = boost::python::objects::make_instance<BlackboxProcessor, boost::python::objects::value_holder<BlackboxProcessor> >; PyObject = _object]’
/usr/include/boost/python/object/class_wrapper.hpp:29:51: required from ‘static PyObject* boost::python::objects::class_cref_wrapper<Src, MakeInstance>::convert(const Src&) [with Src = BlackboxProcessor; MakeInstance = boost::python::objects::make_instance<BlackboxProcessor, boost::python::objects::value_holder<BlackboxProcessor> >; PyObject = _object]’
/usr/include/boost/python/converter/as_to_python_function.hpp:27:61: required from ‘static PyObject* boost::python::converter::as_to_python_function<T, ToPython>::convert(const void*) [with T = BlackboxProcessor; ToPython = boost::python::objects::class_cref_wrapper<BlackboxProcessor, boost::python::objects::make_instance<BlackboxProcessor, boost::python::objects::value_holder<BlackboxProcessor> > >; PyObject = _object]’
/usr/include/boost/python/to_python_converter.hpp:88:9: [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/python/object/class_metadata.hpp:229:80: required from ‘static void boost::python::objects::class_metadata<T, X1, X2, X3>::register_aux2(T2*, Callback) [with T2 = BlackboxProcessor; Callback = boost::integral_constant<bool, false>; T = BlackboxProcessor; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/usr/include/boost/python/object/class_metadata.hpp:219:60: required from ‘static void boost::python::objects::class_metadata<T, X1, X2, X3>::register_aux(void*) [with T = BlackboxProcessor; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/usr/include/boost/python/object/class_metadata.hpp:205:43: required from ‘static void boost::python::objects::class_metadata<T, X1, X2, X3>::register_() [with T = BlackboxProcessor; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/usr/include/boost/python/class.hpp:497:29: required from ‘void boost::python::class_<T, X1, X2, X3>::initialize(const DefVisitor&) [with DefVisitor = boost::python::init<>; W = BlackboxProcessor; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/usr/include/boost/python/class.hpp:630:5: required from ‘boost::python::class_<T, X1, X2, X3>::class_(const char*, const char*) [with W = BlackboxProcessor; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
/home/boooooosh/QuickAccess/Depowdering/blackbox/src/blackbox_skeleton/central_processor.cpp:154:48: required from here
/usr/include/boost/python/object/value_holder.hpp:137:13: error: no matching function for call to ‘BlackboxProcessor::BlackboxProcessor(boost::reference_wrapper<const BlackboxProcessor>::type&)’
BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil)
^
/usr/include/boost/python/object/value_holder.hpp:137:13: note: candidates are:
In file included from /home/boooooosh/QuickAccess/Depowdering/blackbox/src/blackbox_skeleton/central_processor.cpp:12:0:
/home/boooooosh/QuickAccess/Depowdering/blackbox/include/blackbox_skeleton/central_processor.h:72:3: note: BlackboxProcessor::BlackboxProcessor()
BlackboxProcessor() {
^
/home/boooooosh/QuickAccess/Depowdering/blackbox/include/blackbox_skeleton/central_processor.h:72:3: note: candidate expects 0 arguments, 1 provided
/home/boooooosh/QuickAccess/Depowdering/blackbox/include/blackbox_skeleton/central_processor.h:31:7: note: BlackboxProcessor::BlackboxProcessor(BlackboxProcessor&)
class BlackboxProcessor {
boost :: mutexまたはboost :: threadを使用するときはいつでも、このエラーが発生します。 このエラーを引き起こす原因は不明です。
多くの感謝!