Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8353201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:11:17+00:00 2026-06-09T09:11:17+00:00

I compiled the boost 1.50.0 libraries using b2 with the correct Python configuration. Here’s

  • 0

I compiled the boost 1.50.0 libraries using b2 with the correct Python configuration. Here’s the relevant ouput from the command b2 --debug-configuration:

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified cmd-or-prefix: "C:\Python33z\python"
notice: [python-cfg] Checking interpreter command "C:\Python33z\python"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python33z\python.exe" 2>&
1'
notice: [python-cfg] running command '"C:\Python33z\python" -c "from sys import
*; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s'
% (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&
1'    notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified cmd-or-prefix: "C:\Python33z\python"
notice: [python-cfg] Checking interpreter command "C:\Python33z\python"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python33z\python.exe" 2>&
1'
notice: [python-cfg] running command '"C:\Python33z\python" -c "from sys import
*; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s'
% (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&
1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "C:\Python33z\python"
notice: [python-cfg]   include path: "C:\Python33z\Include"
notice: [python-cfg]   library path: "C:\Python33z\libs"
notice: [python-cfg]   DLL search path: "C:\Python33z"
notice: [msvc-cfg] msvc-10.0 detected, command: 'C:\Program Files (x86)\Microsof
t Visual Studio 10.0\VC\bin\cl.exe'
notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.
exe' for msvc, condition <toolset>msvc-10.0

...updating 4 targets...
msvc.archive bin.v2\libs\python\build\msvc-10.0\debug\link-static\threading-mult
i\libboost_python3-vc100-mt-gd-1_50.lib
common.copy stage\lib\libboost_python3-vc100-mt-gd-1_50.lib
bin.v2\libs\python\build\msvc-10.0\debug\link-static\threading-multi\libboost_py
thon3-vc100-mt-gd-1_50.lib
        1 file(s) copied.
msvc.archive bin.v2\libs\python\build\msvc-10.0\release\link-static\threading-mu
lti\libboost_python3-vc100-mt-1_50.lib
common.copy stage\lib\libboost_python3-vc100-mt-1_50.lib
bin.v2\libs\python\build\msvc-10.0\release\link-static\threading-multi\libboost_
python3-vc100-mt-1_50.lib
        1 file(s) copied.
...updated 4 targets...


The Boost C++ Libraries were successfully built!

I have set the linker directories correctly and linked to the appropriate output files (libboost_
python3-vc100-mt-1_50.lib
on release, and libboost_python3-vc100-mt-gd-1_50.lib on debug). I am using a self compiled python distribution, but I’ve tried with the standard ones too and the result isn’t any different.

The link errors I’m getting when I compile are:

error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __thiscall boost::python::detail::str_base::str_base(char const *)" (__imp_??0str_base@detail@python@boost@@IAE@PBD@Z) referenced in function "public: __thiscall boost::python::str::str(char const *)" (??0str@python@boost@@QAE@PBD@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::python::detail::str_base::~str_base(void)" (__imp_??1str_base@detail@python@boost@@QAE@XZ) referenced in function "public: __thiscall boost::python::str::~str(void)" (??1str@python@boost@@QAE@XZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __cdecl boost::python::import(class boost::python::str)" (__imp_?import@python@boost@@YA?AVobject@api@12@Vstr@12@@Z) referenced in function _main
fatal error LNK1120: 3 unresolved externals

The test code which produced those errors boils down to:

using namespace boost::python;
object main_module = import("__main__");

I have used Boost.Filesystem with the same build configuration and it didn’t cause me any problems.

I hope somebody can help me with this issue, it’s really confusing me!

Update: I just read some vague text about the define BOOST_PYTHON_STATIC_LIB; i’m not sure if i’m headed in the right direction with this (since afaik it wasn’t mentioned in the build process), but either way, it gives me an even more confusing error:

LINK : fatal error LNK1104: cannot open file 'python27.lib'

I don’t know why it trys to link with that lib when the python-cfg output clearly shows it found my python33 dist (which my application is already linking with; python33.lib).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:11:20+00:00Added an answer on June 9, 2026 at 9:11 am

    First problem: It turns out defining BOOST_PYTHON_STATIC_LIB was indeed the correct way to fix the unresolved external link errors. It appears to be a necessary define when linking with the static lib; this seems obvious, but it is not mentioned here: http://www.boost.org/doc/libs/1_50_0/libs/python/doc/building.html.

    Second problem: After adding that define, the next link error happened because I didn’t run b2 clean before re-building with the correct Python configuration (ie. nothing was re-compiled until cleaned!), this should have been obvious from the lack of compiler related output, but it did fool me, so it’s just another little thing to look out for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background Using boost and other similar libraries is the easiest way to find compiler
I'm trying to compile using a compiled Boost libs. I can compile using header-only
I have just started with using boost libraries. For one of our projects i
I am learning how to use the boost asio libraries and I am using
I've spent last 2 days trying to launch examples from Boost.Python with the ImportError:
Using Visual Studio 2008 and Boost Libraries 1.46.1 I want to compile and link
I am using boost serialization. I compiled with: -L/opt/local/lib -lboost_serialization -stdlib=libc++ , but got
I must generate a random number using boost libraries, I use this code: boost::mt19937
I'm new to using the Boost C++ Libraries, and I'm trying to compile the
I compiled the Boost C++ libraries as follows: bjam install variant=release link=static threading=multi runtime-link=static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.