boost-python

What is libpython3.so compared with libpython3.5m.so built from python 3.5.2 source?

旧时模样 提交于 2019-12-02 01:16:27
问题 In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14. When I built Python 3.5.2 from source with --with-shared options in Ubuntu, I got libpython3.so (7.6kB) and libpython3.5m.so (12MB). I assume the big one is the real one and the small one might be something forwarding calls to the real interfaces. As boost_python might assume the client to link against python (https://svn.boost.org/trac/boost/ticket/2615), I linked libpython3.so with my application.

What is libpython3.so compared with libpython3.5m.so built from python 3.5.2 source?

房东的猫 提交于 2019-12-01 22:41:53
In my application, I use boost_python and python 3.5.2. All built from source in Ubuntu 14. When I built Python 3.5.2 from source with --with-shared options in Ubuntu, I got libpython3.so (7.6kB) and libpython3.5m.so (12MB). I assume the big one is the real one and the small one might be something forwarding calls to the real interfaces. As boost_python might assume the client to link against python ( https://svn.boost.org/trac/boost/ticket/2615 ), I linked libpython3.so with my application. But when I run it, I got the unresolved symbols error. ldd -r myapp or ldd -r libboost_python.so both

Boost.python automatically convert parameter

心已入冬 提交于 2019-12-01 21:38:55
I am using boost.python to wrap a C++ class 'A' which takes a string as constructor. I then have a function 'fun(A& arg)' which takes a reference to an 'A' as parameter. I would like to have a python wrapper for 'fun' which is such that if I pass a variable which is a reference to a python string, this reference is first automatically converted to a reference to an 'A'. An example might help. On the python side, I would like to be able to do this: a = 'some string' fun(a) and then have 'a' actually be (a reference to) an 'A', not (a reference to) the original string. I want to do this because

Undefined boost python symbol: boost::python::detail::init_module

早过忘川 提交于 2019-12-01 20:55:47
I get an undefined symbol error when trying to import an extension compiled with boost python, and the symbol is one that should be included in the boost library. I am using Boost 1.46.1, Python 3.1.2, and GCC 4.4.5. I've built boost using: $ ./bootstrap.sh --with-python-version=3.1 $ sudo ./bjam -j4 install I then compiled the following trivial Boost Python library: #include <boost/python.hpp> struct mystruct { int i; }; BOOST_PYTHON_MODULE(test) { using namespace boost::python; class_<mystruct>("Mystruct") .def_readwrite("i", &mystruct::i) ; } using the command: $ g++ -shared question.cpp -I

Unable to build Boost.Python

隐身守侯 提交于 2019-12-01 11:32:55
I am trying to build boost.python following this link . When I try to compile using ./b2 or ./bjam , I am getting errors like: error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.6 <target-os>linux matched next alternative: required properties: <python>2.6 <target-os>linux matched The error disappears when I added this line: using python : 2.6 : /usr/bin/python2.6 : /usr/include/python2.6 : /usr/lib/python2.6 : <python-debugging>on ; in /home/kchaitanya/boost/boost_1_50_0/tools/build/v2/user-config.jam However, when compiling now, I get

error to append integer in c++ boost python list

£可爱£侵袭症+ 提交于 2019-12-01 10:43:38
I maked this code and it does not work #include <boost/python.hpp> namespace bp = boost::python; int main(int argc, char **argv) { bp::list points; int one = 1; int two = 2; int three = 3; points.append(one); #crach!! points.append(two); points.append(three); return 0;} which is the reason why "append" does not accept integers and directly which would be the correct way? edited the solution is this: #include <boost/python.hpp> namespace bp = boost::python; int main(int argc, char **argv) { Py_Initialize(); //this part bp::list points; int one = 1; int two = 2; int three = 3; points.append(one)

Unable to build Boost.Python

二次信任 提交于 2019-12-01 08:29:06
问题 I am trying to build boost.python following this link. When I try to compile using ./b2 or ./bjam , I am getting errors like: error: No best alternative for /python_for_extensions next alternative: required properties: <python>2.6 <target-os>linux matched next alternative: required properties: <python>2.6 <target-os>linux matched The error disappears when I added this line: using python : 2.6 : /usr/bin/python2.6 : /usr/include/python2.6 : /usr/lib/python2.6 : <python-debugging>on ; in /home

Puzzling dependency of Boost.Python 1.54 (debug build) to Python27.lib on Windows

僤鯓⒐⒋嵵緔 提交于 2019-12-01 06:53:24
I must be doing some kind of obvious mistake but after hours of fighting I'm unable to make further progress: After upgrading to Boost 1.54, CMake 2.8.12 and Python 2.7.5 (all three from slightly earlier minor versions), the Python bindings of my project no longer link in Debug configuration (they link fine in Release). I'm building with VS 2012. Everything was working properly before the update . I built Boost the standard way: bootstrap.bat followed by b2 address-model=64 toolset=msvc-11.0 . My system has a Python 2.7 installation which is picked up by b2: notice: [python-cfg] Configuring

Python method resolution mystery

梦想与她 提交于 2019-12-01 06:00:47
I can't figure out why this program is failing. #!/usr/bin/env python from __future__ import division, print_function from future_builtins import * import types import libui as ui from PyQt4 import QtCore import sip p = ui.QPoint() q = QtCore.QPoint() def _q_getattr(self, attr): print("get %s" % attr) value = getattr(sip.wrapinstance(self.myself(), QtCore.QPoint), attr) print("get2 %s returned %s" % (attr, value)) return value p.__getattr__ = types.MethodType(_q_getattr, p) print(p.__getattr__('x')()) # Works! Prints "0" print(p.x()) # AttributeError: 'QPoint' object has no attribute 'x' I

How to build a boost dependent project using regular makefiles?

让人想犯罪 __ 提交于 2019-12-01 03:57:42
I'm working on a c++ project, and we recently needed to include a small part of boost in it. The boost part is really minimal (Boost::Python), thus, using bjam to build everything looks like an overkill (besides, everyone working on the project feels comfortable with make, and has no knowloedge of jam). I made quite some tests already, but I cant find a way to include the formerly mentioned library in my makefile and make the build succesful. All your help is deeply apreciated. :) rafak I had the same problem and found a solution in this tutorial . You 1) need to compile the source into an