feelfree
feelfree

Reputation: 11763

Can I compile boost.python module without bjam?

Boost.python module provides a easy way of blinding c/c++ codes into Python. However, most tutorials assume that bjam is used to compile this module. I was wondering if I do not compile this module can I still use this module? What I mean "do not compile this module" is including all the source files of Boost.python in my current project. I did it for other modules from Boost. For example, the Boost.filesystem module, when I use this module, I just include all the files from this module and compile them with the codes I have written. Thanks.

Upvotes: 2

Views: 389

Answers (1)

Dan Mašek
Dan Mašek

Reputation: 19071

Yes, absolutely, it's a library like any other.

I always use it with CMake, but anything will do. You need to

  • Add to include paths the location of the boost headers.
  • Add to include paths the location of python headers (usually installed with Python, location depends on OS)
  • Link with the appropriate boost.python library (e.g. in my case it's boost_python-vc120-mt-1_58.lib or boost_python-vc120-mt-gd-1_58.lib, again depends on version/os/toolkit)

Upvotes: 1

Related Questions