boost::python problem with std::string
Hello! I want to use Boost.python in my program but I have a problem. When I call a C++ function with std::string argument (or const std::string& ) from python, boost.python crashes! I don't know what to do and I hope you can help me. Here is a link to the source code which demonstrates the problem: http://www.powerfly.ru/bug.zip To compile it, you need MS Visual Studio 2005, Python 2.4 and Boost.Python 1.33 or later. -- Sergey A. Makovkin
"Sergey Makovkin" <sergeymak@pisem.net> writes:
Hello!
I want to use Boost.python in my program but I have a problem. When I call a C++ function with std::string argument
You mean parameter
(or const std::string& ) from python,
With a Python str argument?
boost.python crashes! I don't know what to do and I hope you can help me.
Here is a link to the source code which demonstrates the problem: http://www.powerfly.ru/bug.zip To compile it, you need MS Visual Studio 2005, Python 2.4 and Boost.Python 1.33 or later.
Because we test that capability all the time, I can only conclude that your problem is either: 1) a bug somewhere in your code 2) a configuration error in your build I suspect #2, but to rule out #1 you should try a minimal, complete test case that does nothing but call such a function from Python. If that still fails, you have a configuration error in your build. To correct that problem you should follow the official Boost.Python build instructions using bjam (at http://www.boost.org/libs/python/doc/building.html) and add the -d+2 option to examine the command lines generated, comparing them with what your IDE generates. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams -
Sergey Makovkin