質問編集履歴
2
追加のエラーコード
title
CHANGED
File without changes
|
body
CHANGED
@@ -57,151 +57,116 @@
|
|
57
57
|
・clang++によるコンパイル
|
58
58
|
・python.hppが"/usr/local/Cellar/boost/1.76.0/include/boost/python.hpp"にあったので、#includeにフルのパスを入れる
|
59
59
|
|
60
|
-
jbpb0様の質問に関しまして、"/usr/local/opt/boost/include"以下には"boost/"と続き、その下には
|
60
|
+
jbpb0様の質問に関しまして、"/usr/local/opt/boost/include"以下には"boost/"と続き、その下にはpythonとpython.hppのファイルがありました。
|
61
|
+
|
62
|
+
|
63
|
+
・コードのinclude部分を"#include <boost/python.hpp>"として、
|
61
64
|
```
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
histogram test
|
166
|
-
histogram.hpp thread
|
167
|
-
hof thread.hpp
|
168
|
-
hof.hpp throw_exception.hpp
|
169
|
-
icl timer
|
170
|
-
implicit_cast.hpp timer.hpp
|
171
|
-
indirect_reference.hpp token_functions.hpp
|
172
|
-
integer token_iterator.hpp
|
173
|
-
integer.hpp tokenizer.hpp
|
174
|
-
integer_fwd.hpp tti
|
175
|
-
integer_traits.hpp tuple
|
176
|
-
interprocess type.hpp
|
177
|
-
intrusive type_erasure
|
178
|
-
intrusive_ptr.hpp type_index
|
179
|
-
io type_index.hpp
|
180
|
-
io_fwd.hpp type_traits
|
181
|
-
iostreams type_traits.hpp
|
182
|
-
is_placeholder.hpp typeof
|
183
|
-
iterator units
|
184
|
-
iterator.hpp unordered
|
185
|
-
iterator_adaptors.hpp unordered_map.hpp
|
186
|
-
json unordered_set.hpp
|
187
|
-
json.hpp utility
|
188
|
-
lambda utility.hpp
|
189
|
-
leaf uuid
|
190
|
-
leaf.hpp variant
|
191
|
-
lexical_cast variant.hpp
|
192
|
-
lexical_cast.hpp variant2
|
193
|
-
limits.hpp version.hpp
|
194
|
-
local_function visit_each.hpp
|
195
|
-
local_function.hpp vmd
|
196
|
-
locale wave
|
197
|
-
locale.hpp wave.hpp
|
198
|
-
lockfree weak_ptr.hpp
|
199
|
-
log winapi
|
200
|
-
logic xpressive
|
201
|
-
make_default.hpp yap
|
202
|
-
make_shared.hpp
|
65
|
+
g++-11 -Wall -DPIC -shared -fPIC -o sample.so sample.cpp -I/usr/local/opt/boost/include -L/usr/local/lib -lboost_python39 `python3-config --include` `python3-config --ldflags`
|
66
|
+
```
|
67
|
+
としたところ、
|
68
|
+
```
|
69
|
+
In file included from /usr/local/opt/boost/include/boost/python/detail/is_xxx.hpp:8,
|
70
|
+
from /usr/local/opt/boost/include/boost/python/detail/is_auto_ptr.hpp:9,
|
71
|
+
from /usr/local/opt/boost/include/boost/python/detail/copy_ctor_mutates_rhs.hpp:8,
|
72
|
+
from /usr/local/opt/boost/include/boost/python/detail/value_arg.hpp:7,
|
73
|
+
from /usr/local/opt/boost/include/boost/python/object/forward.hpp:10,
|
74
|
+
from /usr/local/opt/boost/include/boost/python/object/pointer_holder.hpp:16,
|
75
|
+
from /usr/local/opt/boost/include/boost/python/to_python_indirect.hpp:10,
|
76
|
+
from /usr/local/opt/boost/include/boost/python/converter/arg_to_python.hpp:10,
|
77
|
+
from /usr/local/opt/boost/include/boost/python/call.hpp:15,
|
78
|
+
from /usr/local/opt/boost/include/boost/python/object_core.hpp:14,
|
79
|
+
from /usr/local/opt/boost/include/boost/python/args.hpp:22,
|
80
|
+
from /usr/local/opt/boost/include/boost/python.hpp:11,
|
81
|
+
from sample.cpp:1:
|
82
|
+
/usr/local/opt/boost/include/boost/python/detail/is_auto_ptr.hpp:17:40: warning: 'template<class> class std::auto_ptr' is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
|
83
|
+
17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1)
|
84
|
+
| ^~~~~~~~
|
85
|
+
/usr/local/opt/boost/include/boost/detail/is_xxx.hpp:20:4: note: in definition of macro 'BOOST_DETAIL_IS_XXX_DEF'
|
86
|
+
20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
|
87
|
+
| ^~~~~~~~~~~~~~
|
88
|
+
/usr/local/opt/boost/include/boost/python/detail/is_auto_ptr.hpp:17:1: note: in expansion of macro 'BOOST_PYTHON_IS_XXX_DEF'
|
89
|
+
17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1)
|
90
|
+
| ^~~~~~~~~~~~~~~~~~~~~~~
|
91
|
+
In file included from /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/memory:76,
|
92
|
+
from /usr/local/opt/boost/include/boost/function/function_base.hpp:16,
|
93
|
+
from /usr/local/opt/boost/include/boost/function/detail/prologue.hpp:17,
|
94
|
+
from /usr/local/opt/boost/include/boost/function/function_template.hpp:13,
|
95
|
+
from /usr/local/opt/boost/include/boost/function/detail/maybe_include.hpp:15,
|
96
|
+
from /usr/local/opt/boost/include/boost/function/function0.hpp:11,
|
97
|
+
from /usr/local/opt/boost/include/boost/python/errors.hpp:13,
|
98
|
+
from /usr/local/opt/boost/include/boost/python/handle.hpp:11,
|
99
|
+
from /usr/local/opt/boost/include/boost/python/args_fwd.hpp:10,
|
100
|
+
from /usr/local/opt/boost/include/boost/python/args.hpp:10,
|
101
|
+
from /usr/local/opt/boost/include/boost/python.hpp:11,
|
102
|
+
from sample.cpp:1:
|
103
|
+
/usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/bits/unique_ptr.h:57:28: note: declared here
|
104
|
+
57 | template<typename> class auto_ptr;
|
105
|
+
| ^~~~~~~~
|
106
|
+
In file included from /usr/local/opt/boost/include/boost/preprocessor/iteration/detail/iter/limits/forward1_256.hpp:14,
|
107
|
+
from /usr/local/opt/boost/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:1343,
|
108
|
+
from /usr/local/opt/boost/include/boost/python/call_method.hpp:32,
|
109
|
+
from /usr/local/opt/boost/include/boost/python.hpp:17,
|
110
|
+
from sample.cpp:1:
|
111
|
+
/usr/local/opt/boost/include/boost/python/call_method.hpp: In function 'typename boost::python::detail::returnable<T>::type boost::python::call_method(PyObject*, const char*, boost::type<Target>*)':
|
112
|
+
/usr/local/opt/boost/include/boost/python/call_method.hpp:61:26: warning: 'PyObject* PyEval_CallMethod(PyObject*, const char*, const char*, ...)' is deprecated [-Wdeprecated-declarations]
|
113
|
+
61 | PyObject* const result =
|
114
|
+
| ~~~~~~~~~~~~~~~~~^~~
|
115
|
+
62 | PyEval_CallMethod(
|
116
|
+
| ~~~~~~~~~~~~~~~~~~
|
117
|
+
63 | self
|
118
|
+
| ~~~~
|
119
|
+
64 | , const_cast<char*>(name)
|
120
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~
|
121
|
+
65 | , const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")")
|
122
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
123
|
+
66 | BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil)
|
124
|
+
| ~
|
125
|
+
In file included from /usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:154,
|
126
|
+
from /usr/local/opt/boost/include/boost/python/detail/wrap_python.hpp:178,
|
127
|
+
from /usr/local/opt/boost/include/boost/python/detail/prefix.hpp:13,
|
128
|
+
from /usr/local/opt/boost/include/boost/python/args.hpp:8,
|
129
|
+
from /usr/local/opt/boost/include/boost/python.hpp:11,
|
130
|
+
from sample.cpp:1:
|
131
|
+
/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/include/python3.9/ceval.h:28:43: note: declared here
|
132
|
+
28 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod(
|
133
|
+
| ^~~~~~~~~~~~~~~~~
|
134
|
+
In file included from /usr/local/opt/boost/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
|
135
|
+
from /usr/local/opt/boost/include/boost/smart_ptr/detail/yield_k.hpp:23,
|
136
|
+
from /usr/local/opt/boost/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
|
137
|
+
from /usr/local/opt/boost/include/boost/smart_ptr/detail/spinlock.hpp:42,
|
138
|
+
from /usr/local/opt/boost/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
|
139
|
+
from /usr/local/opt/boost/include/boost/smart_ptr/shared_ptr.hpp:29,
|
140
|
+
from /usr/local/opt/boost/include/boost/shared_ptr.hpp:17,
|
141
|
+
from /usr/local/opt/boost/include/boost/python/converter/shared_ptr_to_python.hpp:1,
|
142
|
+
from /usr/local/opt/boost/include/boost/python/converter/arg_to_python.hpp:15,
|
143
|
+
from /usr/local/opt/boost/include/boost/python/call.hpp:15,
|
144
|
+
from /usr/local/opt/boost/include/boost/python/object_core.hpp:14,
|
145
|
+
from /usr/local/opt/boost/include/boost/python/args.hpp:22,
|
146
|
+
from /usr/local/opt/boost/include/boost/python.hpp:11,
|
147
|
+
from sample.cpp:1:
|
148
|
+
/usr/local/opt/boost/include/boost/bind.hpp: At global scope:
|
149
|
+
/usr/local/opt/boost/include/boost/config/pragma_message.hpp:24:34: note: '#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.'
|
150
|
+
24 | # define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
|
151
|
+
| ^~~~~~~
|
152
|
+
/usr/local/opt/boost/include/boost/bind.hpp:36:1: note: in expansion of macro 'BOOST_PRAGMA_MESSAGE'
|
153
|
+
36 | BOOST_PRAGMA_MESSAGE(
|
154
|
+
| ^~~~~~~~~~~~~~~~~~~~
|
155
|
+
Undefined symbols for architecture x86_64:
|
156
|
+
"_PyLong_FromLong", referenced from:
|
157
|
+
__ZNK5boost6python15to_python_valueIRKiEclES3_ in ccI3wkJk.o
|
158
|
+
"_PyLong_Type", referenced from:
|
159
|
+
__ZNK5boost6python15to_python_valueIRKiE10get_pytypeEv in ccI3wkJk.o
|
160
|
+
"__Py_Dealloc", referenced from:
|
161
|
+
__Py_DECREF in ccI3wkJk.o
|
162
|
+
"__Py_NoneStruct", referenced from:
|
163
|
+
__ZN5boost6python3api6objectC2Ev in ccI3wkJk.o
|
164
|
+
ld: symbol(s) not found for architecture x86_64
|
165
|
+
collect2: error: ld returned 1 exit status
|
166
|
+
```
|
167
|
+
のエラーが出ました。
|
203
168
|
|
204
|
-
|
169
|
+
|
205
170
|
### 補足情報
|
206
171
|
|
207
172
|
環境
|
1
質問に関するコード入力
title
CHANGED
File without changes
|
body
CHANGED
@@ -57,7 +57,151 @@
|
|
57
57
|
・clang++によるコンパイル
|
58
58
|
・python.hppが"/usr/local/Cellar/boost/1.76.0/include/boost/python.hpp"にあったので、#includeにフルのパスを入れる
|
59
59
|
|
60
|
+
jbpb0様の質問に関しまして、"/usr/local/opt/boost/include"以下には"boost/"と続き、その下には以下のようなファイルがありました。
|
61
|
+
```
|
62
|
+
accumulators make_unique.hpp
|
63
|
+
algorithm math
|
64
|
+
align math_fwd.hpp
|
65
|
+
align.hpp mem_fn.hpp
|
66
|
+
aligned_storage.hpp memory_order.hpp
|
67
|
+
any.hpp metaparse
|
68
|
+
archive metaparse.hpp
|
69
|
+
array.hpp move
|
70
|
+
asio mp11
|
71
|
+
asio.hpp mp11.hpp
|
72
|
+
assert mpi
|
73
|
+
assert.hpp mpi.hpp
|
74
|
+
assign mpl
|
75
|
+
assign.hpp msm
|
76
|
+
atomic multi_array
|
77
|
+
atomic.hpp multi_array.hpp
|
78
|
+
beast multi_index
|
79
|
+
beast.hpp multi_index_container.hpp
|
80
|
+
bimap multi_index_container_fwd.hpp
|
81
|
+
bimap.hpp multiprecision
|
82
|
+
bind next_prior.hpp
|
83
|
+
bind.hpp non_type.hpp
|
84
|
+
blank.hpp noncopyable.hpp
|
85
|
+
blank_fwd.hpp nondet_random.hpp
|
86
|
+
call_traits.hpp none.hpp
|
87
|
+
callable_traits none_t.hpp
|
88
|
+
callable_traits.hpp nowide
|
89
|
+
cast.hpp numeric
|
90
|
+
cerrno.hpp operators.hpp
|
91
|
+
checked_delete.hpp operators_v1.hpp
|
92
|
+
chrono optional
|
93
|
+
chrono.hpp optional.hpp
|
94
|
+
circular_buffer outcome
|
95
|
+
circular_buffer.hpp outcome.hpp
|
96
|
+
circular_buffer_fwd.hpp parameter
|
97
|
+
compatibility parameter.hpp
|
98
|
+
compressed_pair.hpp pending
|
99
|
+
compute pfr
|
100
|
+
compute.hpp pfr.hpp
|
101
|
+
concept phoenix
|
102
|
+
concept_archetype.hpp phoenix.hpp
|
103
|
+
concept_check pointee.hpp
|
104
|
+
concept_check.hpp pointer_cast.hpp
|
105
|
+
config pointer_to_other.hpp
|
106
|
+
config.hpp poly_collection
|
107
|
+
container polygon
|
108
|
+
container_hash polymorphic_cast.hpp
|
109
|
+
context polymorphic_pointer_cast.hpp
|
110
|
+
contract pool
|
111
|
+
contract.hpp predef
|
112
|
+
contract_macro.hpp predef.h
|
113
|
+
convert preprocessor
|
114
|
+
convert.hpp preprocessor.hpp
|
115
|
+
core process
|
116
|
+
coroutine process.hpp
|
117
|
+
coroutine2 program_options
|
118
|
+
crc.hpp program_options.hpp
|
119
|
+
cregex.hpp progress.hpp
|
120
|
+
cstdfloat.hpp property_map
|
121
|
+
cstdint.hpp property_tree
|
122
|
+
cstdlib.hpp proto
|
123
|
+
current_function.hpp ptr_container
|
124
|
+
cxx11_char_types.hpp python
|
125
|
+
date_time python.hpp
|
126
|
+
date_time.hpp qvm
|
127
|
+
detail qvm.hpp
|
128
|
+
dll qvm_lite.hpp
|
129
|
+
dll.hpp random
|
130
|
+
dynamic_bitset random.hpp
|
131
|
+
dynamic_bitset.hpp range
|
132
|
+
dynamic_bitset_fwd.hpp range.hpp
|
133
|
+
enable_shared_from_this.hpp ratio
|
134
|
+
endian ratio.hpp
|
135
|
+
endian.hpp rational.hpp
|
136
|
+
exception ref.hpp
|
137
|
+
exception_ptr.hpp regex
|
138
|
+
fiber regex.h
|
139
|
+
filesystem regex.hpp
|
140
|
+
filesystem.hpp regex_fwd.hpp
|
141
|
+
flyweight safe_numerics
|
142
|
+
flyweight.hpp scope_exit.hpp
|
143
|
+
foreach.hpp scoped_array.hpp
|
144
|
+
foreach_fwd.hpp scoped_ptr.hpp
|
145
|
+
format serialization
|
146
|
+
format.hpp shared_array.hpp
|
147
|
+
function shared_container_iterator.hpp
|
148
|
+
function.hpp shared_ptr.hpp
|
149
|
+
function_equal.hpp signals2
|
150
|
+
function_output_iterator.hpp signals2.hpp
|
151
|
+
function_types smart_ptr
|
152
|
+
functional smart_ptr.hpp
|
153
|
+
functional.hpp sort
|
154
|
+
fusion spirit
|
155
|
+
generator_iterator.hpp spirit.hpp
|
156
|
+
geometry stacktrace
|
157
|
+
geometry.hpp stacktrace.hpp
|
158
|
+
get_pointer.hpp statechart
|
159
|
+
gil static_assert.hpp
|
160
|
+
gil.hpp static_string
|
161
|
+
graph static_string.hpp
|
162
|
+
hana stl_interfaces
|
163
|
+
hana.hpp swap.hpp
|
164
|
+
heap system
|
165
|
+
histogram test
|
166
|
+
histogram.hpp thread
|
167
|
+
hof thread.hpp
|
168
|
+
hof.hpp throw_exception.hpp
|
169
|
+
icl timer
|
170
|
+
implicit_cast.hpp timer.hpp
|
171
|
+
indirect_reference.hpp token_functions.hpp
|
172
|
+
integer token_iterator.hpp
|
173
|
+
integer.hpp tokenizer.hpp
|
174
|
+
integer_fwd.hpp tti
|
175
|
+
integer_traits.hpp tuple
|
176
|
+
interprocess type.hpp
|
177
|
+
intrusive type_erasure
|
178
|
+
intrusive_ptr.hpp type_index
|
179
|
+
io type_index.hpp
|
180
|
+
io_fwd.hpp type_traits
|
181
|
+
iostreams type_traits.hpp
|
182
|
+
is_placeholder.hpp typeof
|
183
|
+
iterator units
|
184
|
+
iterator.hpp unordered
|
185
|
+
iterator_adaptors.hpp unordered_map.hpp
|
186
|
+
json unordered_set.hpp
|
187
|
+
json.hpp utility
|
188
|
+
lambda utility.hpp
|
189
|
+
leaf uuid
|
190
|
+
leaf.hpp variant
|
191
|
+
lexical_cast variant.hpp
|
192
|
+
lexical_cast.hpp variant2
|
193
|
+
limits.hpp version.hpp
|
194
|
+
local_function visit_each.hpp
|
195
|
+
local_function.hpp vmd
|
196
|
+
locale wave
|
197
|
+
locale.hpp wave.hpp
|
198
|
+
lockfree weak_ptr.hpp
|
199
|
+
log winapi
|
200
|
+
logic xpressive
|
201
|
+
make_default.hpp yap
|
202
|
+
make_shared.hpp
|
60
203
|
|
204
|
+
```
|
61
205
|
### 補足情報
|
62
206
|
|
63
207
|
環境
|