mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 18:12:43 +00:00
This commit was manufactured by cvs2svn to create branch 'RC_1_29_0'.
[SVN r15827]
This commit is contained in:
15
example/tutorial/Jamfile
Normal file
15
example/tutorial/Jamfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# Hello World Example from the tutorial
|
||||
# [Joel de Guzman 10/9/2002]
|
||||
|
||||
# Specify our location in the boost project hierarchy
|
||||
subproject libs/python/example/tutorial ;
|
||||
|
||||
# Include definitions needed for Python modules
|
||||
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
|
||||
include python.jam ;
|
||||
|
||||
extension hello # Declare a Python extension called hello
|
||||
: hello.cpp # source
|
||||
<dll>../../build/boost_python # dependencies
|
||||
;
|
||||
|
||||
17
example/tutorial/hello.cpp
Normal file
17
example/tutorial/hello.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Hello World Example from the tutorial
|
||||
// [Joel de Guzman 10/9/2002]
|
||||
|
||||
char const* greet()
|
||||
{
|
||||
return "hello, world";
|
||||
}
|
||||
|
||||
#include <boost/python/module.hpp>
|
||||
#include <boost/python/def.hpp>
|
||||
using namespace boost::python;
|
||||
|
||||
BOOST_PYTHON_MODULE(hello)
|
||||
{
|
||||
def("greet", greet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user