Using boost-python with C ++ on Linux

My development store put together a pretty useful set of tests based on Python, and we would like to test it using C ++ code on Linux. We got a test project that they supply with Boost for compilation (enter "bjam" in the directory and it works), but we are having problems with our actual project.

Building the boost and bjam libraries from source (v1.35.0), when I run bjam, I get .so in the bin / gcc-4.1.2 / debug directory. I run python and "import" and I get: ImportError libboost_python-gcc41-d-1_35.so.1.35.0:: cannot open shared objects file: there is no such file or directory

Looking into the library directory, I have the following: libboost_python-gcc41-mt-1_35.so libboost_python-gcc41-mt-1_35.so.1.35.0 libboost_python-gcc41-mt.so

Obviously, I need -d instead of -mt libraries or specify in -mt libraries instead of -d, but I cannot figure out how to make this Jamroot file like this.

When I install the versions of the Debian Etch libraries, I get "No Jamfile in / usr / include" - and there is a debian error saying that they left the jamfile file at the system level.

I hope to get more work from the source, so if anyone has any suggestions for solving problems with the library, I would like to hear them.

Reply to answer 1: Thanks for the help. So, you know how I'm going to get it to use MT libraries instead? It seems that this is more of a problem with bjam or Jamfile, I use the thinking that I am in debug mode, although I can not find any flags for this. Although I know how to include certain libraries in a GCC call, I see no way to configure this from the end of Boost.

+3
source share
3 answers

: -d , , python (OR NOT, SEE BELOW). debug - pyd - , .

mt d. , mt non-d .

, , gcc, ( Visual Studio). , :

man gcc

- , .

EDIT: - python. python.h, boost/python/detail/wrap_python.hpp.

+2

boost, bjam --build-type=complete.

Debian Python python2.x-dbg. Boost libboost1.xy-dbg, Boost System.

+2

! Boost . "bjam release" . ( , .) , , , . "" , , .

, -d <boost-version>/bin.v2/libs/python/build/<gcc version>/debug/, <gcc-version>/release 'libs'.

!

+2

Source: https://habr.com/ru/post/1696903/


All Articles