basic question on boost.python

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

basic question on boost.python

jian Xu
I just started to learn boost.python .  But I'm getting confused by the simplest
"hello world" example on the boost website:

Here's the C++ program:
char const* greet()
{
   return "hello, world";
}

and the wrapper:

#include <boost/python.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(hello)
{
    def("greet", greet);
}

My first question is, which one is inside the "hello.cpp"?  Or both?
My second question is, shall I how to create a library that python can load?
Shall I just type   "gcc -fPIC hello.cpp" ?  Thanks a lot!


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Reply | Threaded
Open this post in threaded view
|

Re: basic question on boost.python

David Abrahams
jxu <[hidden email]> writes:

> I just started to learn boost.python .  

You're on the wrong list for Boost.Python questions.  Please post to
http://www.boost.org/more/mailing_lists.htm#cplussig

--
Dave Abrahams
Boost Consulting
www.boost-consulting.com


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding