boostorg / boostorg/python

Example of boost/python/call_method.hpp does not compile

オープン
#326 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
537
フォーク
223
平均マージ
11時間 22分
マージ済み PR(30日)
2

説明

I compilled the my_module.cpp file with the following command:
`
gcc -o my_module.o my_module.cpp -c -Wall -fPIC -I/usr/include/python3.6
`

This resulted in the following error:
```
my_module.cpp: In member function ‘virtual const char* Base_callback::class_name() const’:
my_module.cpp:31:44: error: ‘call_method’ was not declared in this scope
char const* class_name() const { return call_method(m_self, "class_name"); }
^~~~~~~~~~~
my_module.cpp:31:56: error: expected primary-expression before ‘char’
char const* class_name() const { return call_method(m_self, "class_name"); }
^~~~
my_module.cpp:31:56: error: expected ‘;’ before ‘char’
my_module.cpp:31:67: error: expected unqualified-id before ‘>’ token
char const* class_name() const { return call_method(m_self, "class_name"); }
^
my_module.cpp:31:67: error: expected initializer before ‘>’ token
my_module.cpp: In function ‘void init_module_tryout()’:
my_module.cpp:40:5: error: ‘def’ was not declared in this scope
def("is_base", is_base);
^~~
makefile:16: recipe for target 'my_module.o' failed
```

The solution was to add the following 2 include statements:
```
#include
#include
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。