简体   繁体   中英

Cannot get Boost to build correctly

I needed to built Boost.Python to work for version 3.2 and I keep running into problems. I followed the instructions in the Getting Started Guide — both the general instructions and those specifically about Boost.Python — and I can't get it to work.

Here's the program I'm trying to run and the link error I'm getting:

#include <boost/python.hpp>
BOOST_PYTHON_MODULE(test) { }
int main() { return 0; }

1>LINK : fatal error LNK1104: cannot open file 'boost_python-vc100-mt-1_48.lib'

Indeed, there is no such file, but there is a ' libboost _python-vc100-mt-1_48.lib' file. (Unsurprisingly, if I try to change its name, it'll give another link error.)

The command I used to install the libraries was:

C:\...\boost_1_48_0> b2 --build-dir=C:\Boost toolset=msvc --build-type=complete install

And the content of my 'user-config.jam' file in my home directory was:

using python : 3.2 : C:/Programming/PythonX86/Python32 ;

It looks like you're only building the static boost_python library binary. Have you tried the following command line options for b2?

link=shared runtime-link=shared

Also, if linking to a static library is acceptable for your needs, adding BOOST_PYTHON_STATIC_LIB to your preprocessor definitions should do the trick...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM