Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#326 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
cpp
領域
backend

調査の方向性

my_module.cpp の例から始め、Python 3.6 のインクルードパスを使用して報告された gcc コマンドを再現します。例のヘッダーを、報告された不足している call_method および def 宣言と照合して確認します。例が必要な Boost.Python ヘッダーをインクルードし、これらのエラーなしでコンパイルできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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<char const*>(m_self, "class_name"); }
                                            ^~~~~~~~~~~
my_module.cpp:31:56: error: expected primary-expression before ‘char’
    char const* class_name() const { return call_method<char const*>(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<char const*>(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 <boost/python/call_method.hpp>
#include <boost/python/def.hpp>
主要言語
C++
スター
537
フォーク
223
平均マージ
11時間 22分
マージ済み PR(30日)
2

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/python のほかの issue

boostorg/python の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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