问题
I am trying to run an example during installation of Boost.Python on my Windows7 64-bit machine.
My boost is installed at C:\local\boost_1_54_0
. Thus at step 3.1.4, I entered
b2 toolset=msvc --build-type=complete --verbose-test test
However, in the command prompt window, I've got 135 unresolved external errors. These errors all point to a serie of files that has the same prefix boost_python-vc110-gd-1_54
, the extentions are such as .rsp
, .dll
etc., and they should be at C:\local\boost_1_54_0\bin.v2\libs\python\build\msvc-11\debug\
.
May I know what am I wrong?
回答1:
This worked for me to build Boost.Python "example"
1.) Unzip boost_1_55_0.zip
2.) Prepare to use the Boost Library Binaries
Go to the boost_1_55_0 root directory and open a command prompt and type following commands:
Bootstrap
3.) Find user-config.jam:
Type following in the command prompt:
ECHO %HOMEDRIVE%%HOMEPATH%
4.) If the user-config.jam is in your homedrive directory please change it there as followed:
ATTENTION:
The .jam language rates a “whitespace” as a separation of arguments!
# -------------------
# MSVC configuration.
# -------------------
# Configure msvc (default version, searched for in standard locations and PATH).
# using msvc ;
# Configure specific msvc version (searched for in standard locations and PATH).
using msvc : 10.0 : C:\\app\\tools\\MSVisualStudio2010\\VC\\bin\\cl.exe ;
….
# ---------------------
# Python configuration.
# ---------------------
# Configure specific Python version.
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;
using python
: 2.5 # Version
: C:\\app\\tools\\Python25\\python.exe # Python Path
: C:\\app\\tools\\Python25\\include # include path
: C:\\app\\tools\\Python25\\libs # lib path(s)
: <define>BOOST_ALL_NO_LIB=1
;
5.) Build the Libraries AFTER configuration!!
Go to the boost_1_55_0 root directory and open a command prompt and type following commands:
.\b2
6.) Copy the user-config.jam to \boost_1_55_0\libs\python\example\tutorial
7.) Go further to \boost_1_55_0\stage\lib\
Rename libboost_python-vc100-mt-gd-1_55.lib to boost_python-vc100-mt-gd-1_55.lib and copy it to
\boost_1_55_0\libs\python\example\tutorial
8.) Now you should have all of these files in the \boost_1_55_0\libs\python\example\tutorial directory
hello.cpp
hello.py
user-config.jam
Jamroot
boost_python-vc100-mt-gd-1_55.lib
bjam.exe
9.) Open a command prompt in \boost_1_55_0\libs\python\example\tutorial
And type following command:
bjam
10.) After successful building..
You should have this file in the directory:
hello_ext.dll
rename this file to:
hello_ext.pyd
回答2:
I don't think you want --build-type=complete, it won't know which one to run. Also, I believe that only the threading=multi, link=shared will work.
I've documented what I had to do to get this working myself.
来源:https://stackoverflow.com/questions/19002587/unresolved-error-when-building-boost-python