[C++-sig] Building Boost Python problem

hbd666 happybrowndog at hotmail.com
Wed Dec 21 10:23:36 CET 2011


Hi I hope someone can help me out...
The object is to build boost python (boost-1.4.8, python 2.7 32bit,  
windows 7 64bit, mingw).
I've been trying to fix this for a good 8 hours but can't figure it out.

bjam --with-python --build-type=complete --toolset=gcc stage

Looking at the resulting output below, I see the problem is probably that  
bjam can't find python27.lib.  I just don't see how that is possible  
because it finds python.exe in C:\Python27 and indeed python27.lib exists  
in the C:\Python27\libs directory.

Resulting output.....

Component configuration:

     - chrono                   : not building
     - date_time                : not building
     - exception                : not building
     - filesystem               : not building
     - graph                    : not building
     - graph_parallel           : not building
     - iostreams                : not building
     - locale                   : not building
     - math                     : not building
     - mpi                      : not building
     - program_options          : not building
     - python                   : building
     - random                   : not building
     - regex                    : not building
     - serialization            : not building
     - signals                  : not building
     - system                   : not building
     - test                     : not building
     - thread                   : not building
     - timer                    : not building
     - wave                     : not building

...patience...
...patience...
...found 1932 targets...
...updating 16 targets...
gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll.a
Creating library file:  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll.abin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\module.o:module.cpp:(.text+0x165):  
undefined reference to `_imp__Py_InitModule4
'
collect2: ld returned 1 exit status

     "g++" -L"C:\Python27\libs" -Wl,-R -Wl,"C:\Python27" -Wl,-R  
-Wl,"C:\Python27\libs"  
"-Wl,--out-implib,bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll.a"  
-o  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll"   
-shared -Wl,--start-group  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\numeric.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\list.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\long.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\dict.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\tuple.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\str.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\slice.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\converter\from_python.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\converter\registry.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\converter\type_id.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\enum.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\class.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\function.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\inheritance.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\life_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\pickle_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\errors.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\module.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\converter\builtin_converters.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\converter\arg_to_python_base.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\stl_iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object_protocol.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object_operators.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\wrapper.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\import.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\exec.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\object\function_doc_signature.o"   
-Wl,-Bstatic  -Wl,-Bdynamic -lpython27 -Wl,--end-group -mthreads

...failed gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll.a  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll...
...removing  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi\libboost_python-mgw46-mt-1_48.dll.a
...skipped <pstage\lib>libboost_python-mgw46-mt-1_48.dll.a for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi>libboost_python-mgw46-mt-1_48.dll.a...
...skipped <pstage\lib>libboost_python-mgw46-mt-1_48.dll for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\release\threading-multi>libboost_python-mgw46-mt-1_48.dll...
gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll.a
Creating library file:  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll.abin.v2\libs\python\build\gcc-mingw-4.6.1\debug\module.o:  
In function `ZN5boost6python6detail11init_moduleEPKcPFvvE':
D:\boost_1_48_0\libs\python\example\quickstart/../../../../libs/python/src/module.cpp:59:  
undefined reference to `_imp__Py_InitModule4
'
collect2: ld returned 1 exit status

     "g++" -L"C:\Python27\libs" -Wl,-R -Wl,"C:\Python27" -Wl,-R  
-Wl,"C:\Python27\libs"  
"-Wl,--out-implib,bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll.a"  
-o  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll"   
-shared -Wl,--start-group  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\numeric.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\list.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\long.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\dict.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\tuple.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\str.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\slice.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\converter\from_python.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\converter\registry.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\converter\type_id.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\enum.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\class.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\function.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\inheritance.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\life_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\pickle_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\errors.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\module.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\converter\builtin_converters.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\converter\arg_to_python_base.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\stl_iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object_protocol.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object_operators.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\wrapper.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\import.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\exec.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\object\function_doc_signature.o"   
-Wl,-Bstatic  -Wl,-Bdynamic -lpython27 -Wl,--end-group -g

...failed gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll.a  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll...
...removing  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\libboost_python-mgw46-d-1_48.dll.a
...skipped <pstage\lib>libboost_python-mgw46-d-1_48.dll.a for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\debug>libboost_python-mgw46-d-1_48.dll.a...
...skipped <pstage\lib>libboost_python-mgw46-d-1_48.dll for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\debug>libboost_python-mgw46-d-1_48.dll...
gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll.a
Creating library file:  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll.abin.v2\libs\python\build\gcc-mingw-4.6.1\release\module.o:module.cpp:(.text+0x165):  
undefined reference to `_imp__Py_InitModule4
'
collect2: ld returned 1 exit status

     "g++" -L"C:\Python27\libs" -Wl,-R -Wl,"C:\Python27" -Wl,-R  
-Wl,"C:\Python27\libs"  
"-Wl,--out-implib,bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll.a"  
-o  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll"   
-shared -Wl,--start-group  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\numeric.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\list.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\long.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\dict.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\tuple.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\str.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\slice.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\converter\from_python.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\converter\registry.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\converter\type_id.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\enum.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\class.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\function.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\inheritance.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\life_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\pickle_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\errors.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\module.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\converter\builtin_converters.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\converter\arg_to_python_base.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\stl_iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object_protocol.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object_operators.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\wrapper.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\import.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\exec.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\release\object\function_doc_signature.o"   
-Wl,-Bstatic  -Wl,-Bdynamic -lpython27 -Wl,--end-group

...failed gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll.a  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll...
...removing  
bin.v2\libs\python\build\gcc-mingw-4.6.1\release\libboost_python-mgw46-1_48.dll.a
...skipped <pstage\lib>libboost_python-mgw46-1_48.dll.a for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\release>libboost_python-mgw46-1_48.dll.a...
...skipped <pstage\lib>libboost_python-mgw46-1_48.dll for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\release>libboost_python-mgw46-1_48.dll...
gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll.a
Creating library file:  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll.abin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\module.o:  
In function `ZN5boost6python6detail11init_moduleEPKcPFvvE':
D:\boost_1_48_0/libs/python/src/module.cpp:59: undefined reference to  
`_imp__Py_InitModule4
'
collect2: ld returned 1 exit status

     "g++" -L"C:\Python27\libs" -Wl,-R -Wl,"C:\Python27" -Wl,-R  
-Wl,"C:\Python27\libs"  
"-Wl,--out-implib,bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll.a"  
-o  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll"   
-shared -Wl,--start-group  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\numeric.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\list.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\long.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\dict.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\tuple.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\str.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\slice.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\converter\from_python.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\converter\registry.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\converter\type_id.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\enum.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\class.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\function.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\inheritance.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\life_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\pickle_support.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\errors.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\module.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\converter\builtin_converters.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\converter\arg_to_python_base.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\stl_iterator.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object_protocol.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object_operators.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\wrapper.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\import.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\exec.o"  
"bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\object\function_doc_signature.o"   
-Wl,-Bstatic  -Wl,-Bdynamic -lpython27 -Wl,--end-group -g -mthreads

...failed gcc.link.dll  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll.a  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll...
...removing  
bin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi\libboost_python-mgw46-mt-d-1_48.dll.a
...skipped <pstage\lib>libboost_python-mgw46-mt-d-1_48.dll.a for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi>libboost_python-mgw46-mt-d-1_48.dll.a...
...skipped <pstage\lib>libboost_python-mgw46-mt-d-1_48.dll for lack of  
<pbin.v2\libs\python\build\gcc-mingw-4.6.1\debug\threading-multi>libboost_python-mgw46-mt-d-1_48.dll...
...failed updating 8 targets...
...skipped 8 targets...



More information about the Cplusplus-sig mailing list