3

I am trying to using Boost.Python.

My system is:

Visual Studio 2012 + Windows7 64-bit + Python 2.7.5 32-bit + Boost 1.54.

Now, I think the Boost.Python is installed, and I can find .dll and .lib files at C:\local\boost_1_54_0\lib32-msvc-11.0, such as boost_python-vc110-mt-gd-1_54.lib.

Then I'm trying to run an example at C:\local\boost_1_54_0\libs\python\example\quickstart in Command Prompt as follows:

bjam toolset=msvc toolset=msvc --verbose-test --debug-configuration test

Then I have some warning as:

notice: [python-cfg] ...requested configuration matched!

notice: [python-cfg] Details of this Python configuration:

notice: [python-cfg] interpreter command: "C:\Python2.7.5\python"

notice: [python-cfg] include path: "C:\Python2.7.5\Include"

notice: [python-cfg] library path: "C:\Python2.7.5\libs"

notice: [python-cfg] DLL search path: "C:\Python2.7.5"

Besides, there are linking errors:

LINK : warning LNK4001: no object files specified; libraries used LINK : error LNK2001: unresolved external symbol _mainCRTStartup bin\test_embed.test\msvc-11.0\debug\test_embed.exe : fatal error LNK1120: 1 unresolved externals

I think that there could be something wrong with the configuration file. In Boost.Python Instruction, I find that there are two files could matter, which are user-config.jam, and boost-build.jam.

For user-config.jam, I find it at C:\local\boost_1_54_0\tools\build\v2, and its content is:

using msvc : 11.0 ;

using python : 2.7 : C:\\Python2.7.5\\ ;

For boost-config.jam, it is everywhere! I don't know which one should I modify. I guess it should be the one that in the same directory with the example. But what its content should be?

Also, I am still not sure if this problem is caused by wrong configuration files or by poor installation of Boost.Python.

Is there a tutorial of bjam syntax? I've googled about it, but every time I was lead back to Boost tutorial.

Can anyone help me work around this? Many thanks. :)

1 Answer 1

4

have you checked the user-config.jam in your home directory:

ECHO %HOMEDRIVE%%HOMEPATH%

the next point is that your user-config.jam isn't complete for your python configuration..

here is an example:

# -------------------
# 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
    ;
Sign up to request clarification or add additional context in comments.

1 Comment

How does one use spaces in jam files? using python : 3.6 # Version : "D:\Program Files\Python36\python.exe" # Python Path ;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.