Commit ed5ff92d authored by robertwb's avatar robertwb

Merge pull request #57 from amcmorl/37486422

update to wrapping c++ documentation
parents a0b0839e 37486422
...@@ -65,6 +65,8 @@ and the implementation in the file called :file:`Rectangle.cpp`: ...@@ -65,6 +65,8 @@ and the implementation in the file called :file:`Rectangle.cpp`:
#include "Rectangle.h" #include "Rectangle.h"
using namespace shapes;
Rectangle::Rectangle(int X0, int Y0, int X1, int Y1) Rectangle::Rectangle(int X0, int Y0, int X1, int Y1)
{ {
x0 = X0; x0 = X0;
...@@ -109,15 +111,15 @@ In Cython :file:`setup.py` scripts, one normally instantiates an Extension ...@@ -109,15 +111,15 @@ In Cython :file:`setup.py` scripts, one normally instantiates an Extension
object. To make Cython generate and compile a C++ source, you just need object. To make Cython generate and compile a C++ source, you just need
to add the keyword ``language="c++"`` to your Extension construction statement, as in:: to add the keyword ``language="c++"`` to your Extension construction statement, as in::
ext = Extension( from distutils.core import setup
"rectangle", # name of extension from distutils.extension import Extension
["rectangle.pyx", "Rectangle.cpp"], # filename of our Cython source from Cython.Distutils import build_ext
language="c++", # this causes Cython to create C++ source
include_dirs=[...], # usual stuff setup(ext_modules=[Extension(
libraries=["stdc++", ...], # ditto "rectangle", # name of extension
extra_link_args=[...], # if needed ["rectangle.pyx", "Rectangle.cpp"], # our Cython source
cmdclass = {'build_ext': build_ext} language="c++")], # causes Cython to create C++ source
) cmdclass={'build_ext': build_ext})
Cython will generate and compile the :file:`rectangle.cpp` file (from the Cython will generate and compile the :file:`rectangle.cpp` file (from the
:file:`rectangle.pyx`), then it will compile :file:`Rectangle.cpp` :file:`rectangle.pyx`), then it will compile :file:`Rectangle.cpp`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment