In your code, after the call del(container), Element::_container is a
dangling pointer. Using
.def("getElement", &Container::getElement, return_internal_reference<>())
should prevent the deletion of container for as long as element
variable will be alive, me understands (ties lifetime of _contein
hi,
have you placed user-config.jam in your %HOMEDRIVE%%HOMEPATH%
location, and configured Python inside it, e.g.
using msvc : 10.0 : : ;
using python
: 2.7 #version
: D:/Python27 # cmd-or-prefix
: D:/Libs/Python273/include #includes
: D:/Libs/Python273/libs #libraries
;
as described
why didn't you follow the example to the end?
Your module is called 'hello_ext'.
2013/9/10 Simon W :
> Hello,
>
> I've compiled the example code for Boost.Python:
>
> #include
>
> char const* greet()
>
> {
>
> return "hello, world";
>
> }
>
> BOOST_PYTHON_MODULE(hello_ext)
>
> {
>
> usin
Before initilizing Python interpreter you need to register your module:
PyImport_AppendInittab("pythonDll", initpythonDll);
regards
2013/1/23 Michael Wild :
> On Wed, Jan 23, 2013 at 8:19 AM, salinea wrote:
>>
>>
>> I create a pyd File named "testPyd" with boostPython,and then I import the
>> te
Hi,
bp::object static_instance()
{
static bp::object* result = new bp::object(boost::ref(A::static_a));
return *result;
}
Instead of exposing a function static_instance in your module, you can
alternatively add a variable to your module's scope:
scope sc;
sc.attr("static_a") = boost::ref(A::
Hello,
I have built Python's (2.7.3) debugging version under Windows, added
"on" in user-config.jam, then run bjam:
bjam -j4 --toolset=msvc --with-python python-debugging=on variant=debug
link=static runtime-link=static,shared
in a.cpp file I included boost python headers this way:
#define BOOST
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
Hi,
add address-model=64 to Boost::Python bjam compilation command and
that's all. Be aware, that not all MSVS versions (e.g. Express
Edition) are equipped with 64 Bit compiler.
2012/8/24 Ronny Herzog :
> Dear all,
>
> I want to build 32 bit extensions and 64 bit extensions on my Windows 7 / 32
>
Hello list,
I am trying to create C++ objects dynamically (some kind of factory)
with use of embedded Python interpreter (i.e. eval).
Naive implementation:
namespace bp = boost::python;
bp::object main_module = ...;
bp::object main_namespace = ...;
bp::object bpo_ob = bp::eval((type+"()").c_str(
Hello list,
correct me if I am wrong, but based on what I have found in the docs,
SO and few other places, when creating an object in Python and passing
it to a wrapped C++ function which expects a pointer and which takes
the ownership of that pointer, one should:
* use auto_ptr as held type when
Exemplary project sent.
W dniu 7 kwietnia 2012 14:29 użytkownik Niall Douglas
napisał:
> On 6 Apr 2012 at 20:33, Payam Shiva wrote:
>
>> Thank you Adam. I tried what you said, but it doesn't work for me. It
>> gave an error, among a bunch of others, that it couldn't find
>> python26.lib. I have P
Wait, don't give up :)
Tomorrow I will send you a msvc solution of a simple application that
embedds python, so that you can check the compilation, ok?
W dniu 6 kwietnia 2012 18:03 użytkownik Payam Shiva
napisał:
> Thank you Adam. I tried what you said, but it doesn't work for me. It
> gave an er
Hi,
I am lost. Do you wan't to build boost::python libraries or an example
using them? Bjam is used for the former only.
regards
W dniu 6 kwietnia 2012 11:14 użytkownik Payam Shiva
napisał:
> I'm totally new to Boost.Python, so I'm trying to follow the tutorial.
> It says to cd to the tutorial
Yes, this is what I meant :)
I will precise my previous message. The docs are very concise on some
topics, hence misleading.
If you find such statement:
"Beware the common pitfall of forgetting that the constructors of most
of Python's mutable types make copies, just as in Python."
then it is con
Here is a part of my message posted here few months ago, which has
been left without any response (no offence - maybe it disappeared
somewhere):
The docs regarding the mutable copying problem are very misleading.
Following Python [1] and Boost [2] scripts do not produce the same results:
[1]
b =
Hello,
I have a few doubts and questions I haven't found answer googling here
and there. I hope you can help me with them.
1. When exposing C++ objects to python using Boost, instance
dictionaries are created only "on demand", the first time the
instance's __dict__ attribute is accessed
[http://wi
ython can handle that for you behind the scenes.
Oh, I wasn't aware of that. Epic.
> Where?!
Sorry, my bad, misunderstanding of docs. Also ptr() method of Object
class enables its use in low-level Python C API functions.
Thanks for help!
2011/11/10 Dave Abrahams :
>
> on Thu Nov 10 2011
Hello,
I am aware about the possibility to register converters to- and from-
Python, which enable the implicit conversions between user-defined and
build-in types in Python.
My question is different: Is it possible to use Boost.Python to
convert existing data structures from C++ to Python?
Simple
18 matches
Mail list logo