差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
c_cpp:boost:boost_python [2020/08/27 20:53] – [ソリューション内の Python プロジェクトで C++ 拡張機能 プロジェクトを参照する] ともやん | c_cpp:boost:boost_python [2021/07/05 01:59] (現在) – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | < | ||
- | < | ||
- | #result pre, #mincode pre { | ||
- | overflow: hidden; | ||
- | font-size: 10px; | ||
- | } | ||
- | # | ||
- | height: 250px; | ||
- | overflow: scroll; | ||
- | overflow-x: hidden; | ||
- | font-size: 10px; | ||
- | } | ||
- | #mintbl table { | ||
- | font-size: 12px; | ||
- | } | ||
- | .dokuwiki .plugin_wrap table { | ||
- | width: auto; | ||
- | } | ||
- | #logo { | ||
- | background-color: | ||
- | padding: 10px; | ||
- | width: fit-content; | ||
- | } | ||
- | #logo p { | ||
- | margin: 0; | ||
- | } | ||
- | </ | ||
- | </ | ||
====== Boost.Python - Boost Python Library ====== | ====== Boost.Python - Boost Python Library ====== | ||
+ | 本家: [[https:// | ||
+ | |||
**Boost Python Library** は、Python と C++ を連携させるためのフレームワークである。Dave Abrahams の C++ コンパイラだけで、特別なツールを使用することなく、C++ クラスの関数やオブジェクトを Python に素早くシームレスに公開できる。\\ | **Boost Python Library** は、Python と C++ を連携させるためのフレームワークである。Dave Abrahams の C++ コンパイラだけで、特別なツールを使用することなく、C++ クラスの関数やオブジェクトを Python に素早くシームレスに公開できる。\\ | ||
行 42: | 行 16: | ||
{{c_cpp: | {{c_cpp: | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
言語: Python | 言語: Python | ||
行 53: | 行 27: | ||
以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | 以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
プロジェクト名: | プロジェクト名: | ||
行 95: | 行 69: | ||
**PyHelloBoostPython** プロジェクトの **PyHelloBoostPython.py** ファイルに以下のコードを貼り付ける。\\ | **PyHelloBoostPython** プロジェクトの **PyHelloBoostPython.py** ファイルに以下のコードを貼り付ける。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
<code python PyHelloBoostPython.py> | <code python PyHelloBoostPython.py> | ||
# | # | ||
行 156: | 行 130: | ||
{{c_cpp: | {{c_cpp: | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
言語: C++ | 言語: C++ | ||
行 167: | 行 141: | ||
以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | 以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
プロジェクト名: | プロジェクト名: | ||
行 177: | 行 151: | ||
**superfastcode_cpython** プロジェクトを右クリックして、**[追加] - [新しい項目...]** をクリックする。\\ | **superfastcode_cpython** プロジェクトを右クリックして、**[追加] - [新しい項目...]** をクリックする。\\ | ||
以下の内容で新しい項目を追加する。\\ | 以下の内容で新しい項目を追加する。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
種類: C++ ファイル (.cpp) | 種類: C++ ファイル (.cpp) | ||
行 193: | 行 167: | ||
これにより、**Debug、Release、Win32、x64** のすべての組み合わせについての設定を変更する。\\ | これにより、**Debug、Release、Win32、x64** のすべての組み合わせについての設定を変更する。\\ | ||
**CPython プロジェクト** (Python 用 C++ 拡張機能) のビルドに必要な設定の概要は以下の通りである。\\ | **CPython プロジェクト** (Python 用 C++ 拡張機能) のビルドに必要な設定の概要は以下の通りである。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
[構成プロパティ] - [全般] - [構成の種類]: | [構成プロパティ] - [全般] - [構成の種類]: | ||
行 226: | 行 200: | ||
**superfastcode_cpython** プロジェクトの **cpython_module.cpp** ファイルに以下の内容を貼り付ける。\\ | **superfastcode_cpython** プロジェクトの **cpython_module.cpp** ファイルに以下の内容を貼り付ける。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
<code cpp cpython_module.cpp> | <code cpp cpython_module.cpp> | ||
#include < | #include < | ||
行 279: | 行 253: | ||
{{c_cpp: | {{c_cpp: | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
言語: C++ | 言語: C++ | ||
行 290: | 行 264: | ||
以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | 以下の内容で新しいプロジェクトを構成して **[作成]** をクリックする。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
プロジェクト名: | プロジェクト名: | ||
行 300: | 行 274: | ||
**superfastcode_boost** プロジェクトを右クリックして、**[追加] - [新しい項目...]** をクリックする。\\ | **superfastcode_boost** プロジェクトを右クリックして、**[追加] - [新しい項目...]** をクリックする。\\ | ||
以下の内容で新しい項目を追加する。\\ | 以下の内容で新しい項目を追加する。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
種類: C++ ファイル (.cpp) | 種類: C++ ファイル (.cpp) | ||
行 313: | 行 287: | ||
これにより、**Debug、Release、Win32、x64** のすべての組み合わせについての設定を変更する。\\ | これにより、**Debug、Release、Win32、x64** のすべての組み合わせについての設定を変更する。\\ | ||
**Boost.Python プロジェクト** (Python 用 C++ 拡張機能) のビルドに必要な設定の概要は以下の通りである。\\ | **Boost.Python プロジェクト** (Python 用 C++ 拡張機能) のビルドに必要な設定の概要は以下の通りである。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
< | < | ||
[構成プロパティ] - [全般] - [構成の種類]: | [構成プロパティ] - [全般] - [構成の種類]: | ||
行 346: | 行 320: | ||
**superfastcode_boost** プロジェクトの **boost_module.cpp** ファイルに以下の内容を貼り付ける。\\ | **superfastcode_boost** プロジェクトの **boost_module.cpp** ファイルに以下の内容を貼り付ける。\\ | ||
- | <WRAP prewrap 100% #mincode> | + | <WRAP prewrap 100% mincode> |
<code cpp boost_module.cpp> | <code cpp boost_module.cpp> | ||
#include < | #include < | ||
行 379: | 行 353: | ||
**アクティブ ソリューション構成: | **アクティブ ソリューション構成: | ||
- | <WRAP prewrap 100% #mintbl> | + | <WRAP prewrap 100% mintbl> |
^ プロジェクト | ^ プロジェクト | ||
|superfastcode_boost | |superfastcode_boost | ||
行 388: | 行 362: | ||
**アクティブ ソリューション構成: | **アクティブ ソリューション構成: | ||
- | <WRAP prewrap 100% #mintbl> | + | <WRAP prewrap 100% mintbl> |
^ プロジェクト | ^ プロジェクト | ||
|superfastcode_boost | |superfastcode_boost | ||
行 429: | 行 403: | ||
[[https:// | [[https:// | ||
[[http:// | [[http:// | ||
+ | |||
+ | [[http:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||