Building Boost Python problem

classic Classic list List threaded Threaded
7 messages Options
hbd
Reply | Threaded
Open this post in threaded view
|

Building Boost Python problem

hbd
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...

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

Davidson, Josh
I'm attaching my notes below.  I will point out that while the directions reference 1.48, I've actually had problems with 1.48 and MinGW-W64.  Specifically, I'm having problems with bjam building all libraries at once.  Building individually appears to work, but I haven't bothered trying to build each one on its own yet.   I've inquired on boost-build, but haven't heard anything back.  Personally, I would recommend 1.47.  If you'd like the def file referenced in the instructions, shoot me a personal email and I'll forward it to you.  Keep in mind that you *cannot* use a 32-bit def file if you are using 64-bit Python.  I will also forewarn you there are other issues with x64 Python and MinGW-W64 if you plan on building extensions.  Take a look here: http://bugs.python.org/issue4709


---Building Boost for MinGW-----

h1. Building Boost

Building Boost for MinGw is the opposite of fun.  Here are some notes to get you through the misery.


h2. x64 Windows

*Directories*
* C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
* c:\mingw64-i686-20110207 - 64-bit MinGw
* C:\Python26 - 64-bit Python installation (2.6.6)
* C:\TEMP\boost_build - Directory for storing build output

*Steps*
# Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
# C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw --toolset-root=c:\mingw64-i686-20110207
# Copy bin.<arch>/* to <mingw_root>/bin
# Change into C:\TEMP\boost_1_48_0
# C:\TEMP\boost_1_48_0>bootstrap.bat mingw --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26
# Make a temporary boost build directory, C:\TEMP\boost_build
# Work through the following steps to workaround a bug that has been around for years, but seemingly will never get fixed:
<pre>1. Open tools/build/v2/tools/python.jam
2. There, locate the following code:
if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT )
{
    # Prior to version 3.1.17 Boost Jam's SHELL command did not support
    # quoted commands correctly on Windows. This means that on that
    # platform we do not support using a Python command interpreter
    # executable whose path contains a space character.
    python-cmd = \"$(python-cmd)\" ;
}
3. Remove that code block completely. </pre>
# Grab attachment:python26.def
# Copy c:\windows\System32\python26.dll to the same location as attachment:python26.def
# Execute: @dlltool --dllname python26.dll --def python26.def --output-lib libpython26.a@
# Copy libpython26.a to C:\Python26\libs
# pre>
bjam.exe --toolset=gcc --build-type=complete --build-dir=C:\TEMP\boost_build\build --stagedir=C:\TEMP\boost_build\stage -- address-model=64 define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage
</pre>
# Copy all files under C:\temp\boost_build\stage\lib to c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
# Copy C:\TEMP\boost_1_48_0\boost to c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of hbd666
Sent: Wednesday, December 21, 2011 2:24 AM
To: [hidden email]
Subject: EXTERNAL: [C++-sig] Building Boost Python problem

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...

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

Davidson, Josh
In reply to this post by hbd
Whoops, just realized you're using Python 2.7, so my def file won't help you.  You need to get a x64 def file for your version of Python (there are ways to generate these, google) and run it against dlltool (see notes in previous response) to generate a libpython27.a

-----Original Message-----
From: Davidson, Josh
Sent: Wednesday, December 21, 2011 9:53 AM
To: [hidden email]
Subject: RE: EXTERNAL: [C++-sig] Building Boost Python problem

I'm attaching my notes below.  I will point out that while the directions reference 1.48, I've actually had problems with 1.48 and MinGW-W64.  Specifically, I'm having problems with bjam building all libraries at once.  Building individually appears to work, but I haven't bothered trying to build each one on its own yet.   I've inquired on boost-build, but haven't heard anything back.  Personally, I would recommend 1.47.  If you'd like the def file referenced in the instructions, shoot me a personal email and I'll forward it to you.  Keep in mind that you *cannot* use a 32-bit def file if you are using 64-bit Python.  I will also forewarn you there are other issues with x64 Python and MinGW-W64 if you plan on building extensions.  Take a look here: http://bugs.python.org/issue4709


---Building Boost for MinGW-----

h1. Building Boost

Building Boost for MinGw is the opposite of fun.  Here are some notes to get you through the misery.


h2. x64 Windows

*Directories*
* C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
* c:\mingw64-i686-20110207 - 64-bit MinGw
* C:\Python26 - 64-bit Python installation (2.6.6)
* C:\TEMP\boost_build - Directory for storing build output

*Steps*
# Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
# C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw --toolset-root=c:\mingw64-i686-20110207
# Copy bin.<arch>/* to <mingw_root>/bin
# Change into C:\TEMP\boost_1_48_0
# C:\TEMP\boost_1_48_0>bootstrap.bat mingw --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26 # Make a temporary boost build directory, C:\TEMP\boost_build # Work through the following steps to workaround a bug that has been around for years, but seemingly will never get fixed:
<pre>1. Open tools/build/v2/tools/python.jam
2. There, locate the following code:
if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT ) {
    # Prior to version 3.1.17 Boost Jam's SHELL command did not support
    # quoted commands correctly on Windows. This means that on that
    # platform we do not support using a Python command interpreter
    # executable whose path contains a space character.
    python-cmd = \"$(python-cmd)\" ;
}
3. Remove that code block completely. </pre>
# Grab attachment:python26.def
# Copy c:\windows\System32\python26.dll to the same location as attachment:python26.def # Execute: @dlltool --dllname python26.dll --def python26.def --output-lib libpython26.a@ # Copy libpython26.a to C:\Python26\libs # pre> bjam.exe --toolset=gcc --build-type=complete --build-dir=C:\TEMP\boost_build\build --stagedir=C:\TEMP\boost_build\stage -- address-model=64 define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage </pre> # Copy all files under C:\temp\boost_build\stage\lib to c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
# Copy C:\TEMP\boost_1_48_0\boost to c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of hbd666
Sent: Wednesday, December 21, 2011 2:24 AM
To: [hidden email]
Subject: EXTERNAL: [C++-sig] Building Boost Python problem

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...

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
hbd
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

hbd
Thanks so much for the help.  In my original post, I did say I am using 32  
bit python ver 2.7.
Shall I still get a x64 def file?  Is this because I am on Windows 7 64  
bit?  I just wanted to be clear.
By the way, where does the def file go and how is it referenced?

On Wed, 21 Dec 2011 08:58:07 -0800, Davidson, Josh  
<[hidden email]> wrote:

> Whoops, just realized you're using Python 2.7, so my def file won't help  
> you.  You need to get a x64 def file for your version of Python (there  
> are ways to generate these, google) and run it against dlltool (see  
> notes in previous response) to generate a libpython27.a
>
> -----Original Message-----
> From: Davidson, Josh
> Sent: Wednesday, December 21, 2011 9:53 AM
> To: [hidden email]
> Subject: RE: EXTERNAL: [C++-sig] Building Boost Python problem
>
> I'm attaching my notes below.  I will point out that while the  
> directions reference 1.48, I've actually had problems with 1.48 and  
> MinGW-W64.  Specifically, I'm having problems with bjam building all  
> libraries at once.  Building individually appears to work, but I haven't  
> bothered trying to build each one on its own yet.   I've inquired on  
> boost-build, but haven't heard anything back.  Personally, I would  
> recommend 1.47.  If you'd like the def file referenced in the  
> instructions, shoot me a personal email and I'll forward it to you.  
> Keep in mind that you *cannot* use a 32-bit def file if you are using  
> 64-bit Python.  I will also forewarn you there are other issues with x64  
> Python and MinGW-W64 if you plan on building extensions.  Take a look  
> here: http://bugs.python.org/issue4709
>
>
> ---Building Boost for MinGW-----
>
> h1. Building Boost
>
> Building Boost for MinGw is the opposite of fun.  Here are some notes to  
> get you through the misery.
>
>
> h2. x64 Windows
>
> *Directories*
> * C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
> * c:\mingw64-i686-20110207 - 64-bit MinGw
> * C:\Python26 - 64-bit Python installation (2.6.6)
> * C:\TEMP\boost_build - Directory for storing build output
>
> *Steps*
> # Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
> # C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw  
> --toolset-root=c:\mingw64-i686-20110207
> # Copy bin.<arch>/* to <mingw_root>/bin
> # Change into C:\TEMP\boost_1_48_0
> # C:\TEMP\boost_1_48_0>bootstrap.bat mingw  
> --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26 #  
> Make a temporary boost build directory, C:\TEMP\boost_build # Work  
> through the following steps to workaround a bug that has been around for  
> years, but seemingly will never get fixed:
> <pre>1. Open tools/build/v2/tools/python.jam
> 2. There, locate the following code:
> if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT ) {
>     # Prior to version 3.1.17 Boost Jam's SHELL command did not support
>     # quoted commands correctly on Windows. This means that on that
>     # platform we do not support using a Python command interpreter
>     # executable whose path contains a space character.
>     python-cmd = \"$(python-cmd)\" ;
> }
> 3. Remove that code block completely. </pre>
> # Grab attachment:python26.def
> # Copy c:\windows\System32\python26.dll to the same location as  
> attachment:python26.def # Execute: @dlltool --dllname python26.dll --def  
> python26.def --output-lib libpython26.a@ # Copy libpython26.a to  
> C:\Python26\libs # pre> bjam.exe --toolset=gcc --build-type=complete  
> --build-dir=C:\TEMP\boost_build\build  
> --stagedir=C:\TEMP\boost_build\stage -- address-model=64  
> define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage  
> </pre> # Copy all files under C:\temp\boost_build\stage\lib to  
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
> # Copy C:\TEMP\boost_1_48_0\boost to  
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude
>
> -----Original Message-----
> From: cplusplus-sig-bounces+josh.davidson=[hidden email]  
> [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On  
> Behalf Of hbd666
> Sent: Wednesday, December 21, 2011 2:24 AM
> To: [hidden email]
> Subject: EXTERNAL: [C++-sig] Building Boost Python problem
>
> 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...
>
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

Davidson, Josh
Looks like I had sudden onset of dyslexia while scanning your build output, read mgw46 as mgw64, and thought you were using 64-bit MinGW and therefore 64-bit Python.  The def file exposes all of the exports for the Python dll, so you can create an import library that MinGW can interpret.  You can grab a 32-bit def file for Pyton 2.7 here: http://wiki.cython.org/InstallingOnWindows (please note that the def files listed are 32-bit only even though there is no mention of that).  Follow the instructions on their page for how to create the import library using dlltool (replacing their references to Python 2.4 and Python 2.5 with Python 2.7).



-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of hbd666
Sent: Wednesday, December 21, 2011 10:53 AM
To: [hidden email]
Subject: Re: [C++-sig] EXTERNAL: Building Boost Python problem

Thanks so much for the help.  In my original post, I did say I am using 32 bit python ver 2.7.
Shall I still get a x64 def file?  Is this because I am on Windows 7 64 bit?  I just wanted to be clear.
By the way, where does the def file go and how is it referenced?

On Wed, 21 Dec 2011 08:58:07 -0800, Davidson, Josh <[hidden email]> wrote:

> Whoops, just realized you're using Python 2.7, so my def file won't
> help you.  You need to get a x64 def file for your version of Python
> (there are ways to generate these, google) and run it against dlltool
> (see notes in previous response) to generate a libpython27.a
>
> -----Original Message-----
> From: Davidson, Josh
> Sent: Wednesday, December 21, 2011 9:53 AM
> To: [hidden email]
> Subject: RE: EXTERNAL: [C++-sig] Building Boost Python problem
>
> I'm attaching my notes below.  I will point out that while the
> directions reference 1.48, I've actually had problems with 1.48 and
> MinGW-W64.  Specifically, I'm having problems with bjam building all
> libraries at once.  Building individually appears to work, but I haven't
> bothered trying to build each one on its own yet.   I've inquired on  
> boost-build, but haven't heard anything back.  Personally, I would
> recommend 1.47.  If you'd like the def file referenced in the
> instructions, shoot me a personal email and I'll forward it to you.  
> Keep in mind that you *cannot* use a 32-bit def file if you are using
> 64-bit Python.  I will also forewarn you there are other issues with
> x64 Python and MinGW-W64 if you plan on building extensions.  Take a
> look
> here: http://bugs.python.org/issue4709
>
>
> ---Building Boost for MinGW-----
>
> h1. Building Boost
>
> Building Boost for MinGw is the opposite of fun.  Here are some notes
> to get you through the misery.
>
>
> h2. x64 Windows
>
> *Directories*
> * C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
> * c:\mingw64-i686-20110207 - 64-bit MinGw
> * C:\Python26 - 64-bit Python installation (2.6.6)
> * C:\TEMP\boost_build - Directory for storing build output
>
> *Steps*
> # Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
> # C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw
> --toolset-root=c:\mingw64-i686-20110207
> # Copy bin.<arch>/* to <mingw_root>/bin # Change into
> C:\TEMP\boost_1_48_0 # C:\TEMP\boost_1_48_0>bootstrap.bat mingw
> --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26
> # Make a temporary boost build directory, C:\TEMP\boost_build # Work
> through the following steps to workaround a bug that has been around
> for years, but seemingly will never get fixed:
> <pre>1. Open tools/build/v2/tools/python.jam
> 2. There, locate the following code:
> if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT ) {
>     # Prior to version 3.1.17 Boost Jam's SHELL command did not support
>     # quoted commands correctly on Windows. This means that on that
>     # platform we do not support using a Python command interpreter
>     # executable whose path contains a space character.
>     python-cmd = \"$(python-cmd)\" ;
> }
> 3. Remove that code block completely. </pre>
> # Grab attachment:python26.def
> # Copy c:\windows\System32\python26.dll to the same location as
> attachment:python26.def # Execute: @dlltool --dllname python26.dll
> --def python26.def --output-lib libpython26.a@ # Copy libpython26.a to
> C:\Python26\libs # pre> bjam.exe --toolset=gcc --build-type=complete
> --build-dir=C:\TEMP\boost_build\build
> --stagedir=C:\TEMP\boost_build\stage -- address-model=64
> define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage
> </pre> # Copy all files under C:\temp\boost_build\stage\lib to
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
> # Copy C:\TEMP\boost_1_48_0\boost to
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude
>
> -----Original Message-----
> From: cplusplus-sig-bounces+josh.davidson=[hidden email]
> [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On
> Behalf Of hbd666
> Sent: Wednesday, December 21, 2011 2:24 AM
> To: [hidden email]
> Subject: EXTERNAL: [C++-sig] Building Boost Python problem
>
> 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\libbo
> ost_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\libbo
> ost_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\libbo
> ost_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\libboos
> t_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\libboos
> t_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\libboos
> t_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...
>
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

Davidson, Josh
In reply to this post by hbd
One other thing that jumps out at me from your build output is the undefined symbol is Py_InitModule4.  That's a special guard symbol they add to their 32-bit libraries.  64-bit versions have Py_InitModule4_64.  This is to prevent you from linking a 32 bit modules with 64-bit Python and vice-versa.  I would have expected to see a bunch more undefined symbols.  If generating the mport library doesn't work, make sure you add --address-model=32 when invoking bjam.exe and can you post the output from gcc -v.

-----Original Message-----
From: Davidson, Josh
Sent: Wednesday, December 21, 2011 11:34 AM
To: [hidden email]
Subject: RE: [C++-sig] EXTERNAL: Building Boost Python problem

Looks like I had sudden onset of dyslexia while scanning your build output, read mgw46 as mgw64, and thought you were using 64-bit MinGW and therefore 64-bit Python.  The def file exposes all of the exports for the Python dll, so you can create an import library that MinGW can interpret.  You can grab a 32-bit def file for Pyton 2.7 here: http://wiki.cython.org/InstallingOnWindows (please note that the def files listed are 32-bit only even though there is no mention of that).  Follow the instructions on their page for how to create the import library using dlltool (replacing their references to Python 2.4 and Python 2.5 with Python 2.7).



-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of hbd666
Sent: Wednesday, December 21, 2011 10:53 AM
To: [hidden email]
Subject: Re: [C++-sig] EXTERNAL: Building Boost Python problem

Thanks so much for the help.  In my original post, I did say I am using 32 bit python ver 2.7.
Shall I still get a x64 def file?  Is this because I am on Windows 7 64 bit?  I just wanted to be clear.
By the way, where does the def file go and how is it referenced?

On Wed, 21 Dec 2011 08:58:07 -0800, Davidson, Josh <[hidden email]> wrote:

> Whoops, just realized you're using Python 2.7, so my def file won't
> help you.  You need to get a x64 def file for your version of Python
> (there are ways to generate these, google) and run it against dlltool
> (see notes in previous response) to generate a libpython27.a
>
> -----Original Message-----
> From: Davidson, Josh
> Sent: Wednesday, December 21, 2011 9:53 AM
> To: [hidden email]
> Subject: RE: EXTERNAL: [C++-sig] Building Boost Python problem
>
> I'm attaching my notes below.  I will point out that while the
> directions reference 1.48, I've actually had problems with 1.48 and
> MinGW-W64.  Specifically, I'm having problems with bjam building all
> libraries at once.  Building individually appears to work, but I haven't
> bothered trying to build each one on its own yet.   I've inquired on  
> boost-build, but haven't heard anything back.  Personally, I would
> recommend 1.47.  If you'd like the def file referenced in the
> instructions, shoot me a personal email and I'll forward it to you.  
> Keep in mind that you *cannot* use a 32-bit def file if you are using
> 64-bit Python.  I will also forewarn you there are other issues with
> x64 Python and MinGW-W64 if you plan on building extensions.  Take a
> look
> here: http://bugs.python.org/issue4709
>
>
> ---Building Boost for MinGW-----
>
> h1. Building Boost
>
> Building Boost for MinGw is the opposite of fun.  Here are some notes
> to get you through the misery.
>
>
> h2. x64 Windows
>
> *Directories*
> * C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
> * c:\mingw64-i686-20110207 - 64-bit MinGw
> * C:\Python26 - 64-bit Python installation (2.6.6)
> * C:\TEMP\boost_build - Directory for storing build output
>
> *Steps*
> # Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
> # C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw
> --toolset-root=c:\mingw64-i686-20110207
> # Copy bin.<arch>/* to <mingw_root>/bin # Change into
> C:\TEMP\boost_1_48_0 # C:\TEMP\boost_1_48_0>bootstrap.bat mingw
> --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26
> # Make a temporary boost build directory, C:\TEMP\boost_build # Work
> through the following steps to workaround a bug that has been around
> for years, but seemingly will never get fixed:
> <pre>1. Open tools/build/v2/tools/python.jam
> 2. There, locate the following code:
> if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT ) {
>     # Prior to version 3.1.17 Boost Jam's SHELL command did not support
>     # quoted commands correctly on Windows. This means that on that
>     # platform we do not support using a Python command interpreter
>     # executable whose path contains a space character.
>     python-cmd = \"$(python-cmd)\" ;
> }
> 3. Remove that code block completely. </pre>
> # Grab attachment:python26.def
> # Copy c:\windows\System32\python26.dll to the same location as
> attachment:python26.def # Execute: @dlltool --dllname python26.dll
> --def python26.def --output-lib libpython26.a@ # Copy libpython26.a to
> C:\Python26\libs # pre> bjam.exe --toolset=gcc --build-type=complete
> --build-dir=C:\TEMP\boost_build\build
> --stagedir=C:\TEMP\boost_build\stage -- address-model=64
> define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage
> </pre> # Copy all files under C:\temp\boost_build\stage\lib to
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
> # Copy C:\TEMP\boost_1_48_0\boost to
> c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude
>
> -----Original Message-----
> From: cplusplus-sig-bounces+josh.davidson=[hidden email]
> [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On
> Behalf Of hbd666
> Sent: Wednesday, December 21, 2011 2:24 AM
> To: [hidden email]
> Subject: EXTERNAL: [C++-sig] Building Boost Python problem
>
> 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\libbo
> ost_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\libbo
> ost_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\libbo
> ost_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\libboos
> t_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\libboos
> t_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\libboos
> t_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...
>
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
hbd
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Building Boost Python problem

hbd
In reply to this post by Davidson, Josh
Josh,

Thank you so much.  I got the def file and now I have success: I was able  
to build Boost-python
in both static and dynamic libraries!  I had generated a def file before  
with pexports and had
a libpython27.a in c:\python27\libs but for whatever reason I still got  
those undefined symbol
errors.  So I downloaded the def file from that site and reran the  
dlltool, then did the build
and it worked.  I also did the python boost quickstart build and that also  
worked.

You just gave me an early Christmas present... thanks so much and Merry  
Christmas to you!


On Wed, 21 Dec 2011 10:34:14 -0800, Davidson, Josh  
<[hidden email]> wrote:

> Looks like I had sudden onset of dyslexia while scanning your build  
> output, read mgw46 as mgw64, and thought you were using 64-bit MinGW and  
> therefore 64-bit Python.  The def file exposes all of the exports for  
> the Python dll, so you can create an import library that MinGW can  
> interpret.  You can grab a 32-bit def file for Pyton 2.7 here:  
> http://wiki.cython.org/InstallingOnWindows (please note that the def  
> files listed are 32-bit only even though there is no mention of that).  
> Follow the instructions on their page for how to create the import  
> library using dlltool (replacing their references to Python 2.4 and  
> Python 2.5 with Python 2.7).
>
>
>
> -----Original Message-----
> From: cplusplus-sig-bounces+josh.davidson=[hidden email]  
> [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On  
> Behalf Of hbd666
> Sent: Wednesday, December 21, 2011 10:53 AM
> To: [hidden email]
> Subject: Re: [C++-sig] EXTERNAL: Building Boost Python problem
>
> Thanks so much for the help.  In my original post, I did say I am using  
> 32 bit python ver 2.7.
> Shall I still get a x64 def file?  Is this because I am on Windows 7 64  
> bit?  I just wanted to be clear.
> By the way, where does the def file go and how is it referenced?
>
> On Wed, 21 Dec 2011 08:58:07 -0800, Davidson, Josh  
> <[hidden email]> wrote:
>
>> Whoops, just realized you're using Python 2.7, so my def file won't
>> help you.  You need to get a x64 def file for your version of Python
>> (there are ways to generate these, google) and run it against dlltool
>> (see notes in previous response) to generate a libpython27.a
>>
>> -----Original Message-----
>> From: Davidson, Josh
>> Sent: Wednesday, December 21, 2011 9:53 AM
>> To: [hidden email]
>> Subject: RE: EXTERNAL: [C++-sig] Building Boost Python problem
>>
>> I'm attaching my notes below.  I will point out that while the
>> directions reference 1.48, I've actually had problems with 1.48 and
>> MinGW-W64.  Specifically, I'm having problems with bjam building all
>> libraries at once.  Building individually appears to work, but I haven't
>> bothered trying to build each one on its own yet.   I've inquired on
>> boost-build, but haven't heard anything back.  Personally, I would
>> recommend 1.47.  If you'd like the def file referenced in the
>> instructions, shoot me a personal email and I'll forward it to you.
>> Keep in mind that you *cannot* use a 32-bit def file if you are using
>> 64-bit Python.  I will also forewarn you there are other issues with
>> x64 Python and MinGW-W64 if you plan on building extensions.  Take a
>> look
>> here: http://bugs.python.org/issue4709
>>
>>
>> ---Building Boost for MinGW-----
>>
>> h1. Building Boost
>>
>> Building Boost for MinGw is the opposite of fun.  Here are some notes
>> to get you through the misery.
>>
>>
>> h2. x64 Windows
>>
>> *Directories*
>> * C:\TEMP\boost_1_48_0 - Where Boost source code was extracted
>> * c:\mingw64-i686-20110207 - 64-bit MinGw
>> * C:\Python26 - 64-bit Python installation (2.6.6)
>> * C:\TEMP\boost_build - Directory for storing build output
>>
>> *Steps*
>> # Enter C:\TEMP\boost_1_48_0\tools\build\v2\engine
>> # C:\TEMP\boost_1_48_0\tools\build\v2\engine>build.bat mingw
>> --toolset-root=c:\mingw64-i686-20110207
>> # Copy bin.<arch>/* to <mingw_root>/bin # Change into
>> C:\TEMP\boost_1_48_0 # C:\TEMP\boost_1_48_0>bootstrap.bat mingw
>> --toolset-root=c:\mingw64-i686-20110207 --with-python-root=C:\Python26
>> # Make a temporary boost build directory, C:\TEMP\boost_build # Work
>> through the following steps to workaround a bug that has been around
>> for years, but seemingly will never get fixed:
>> <pre>1. Open tools/build/v2/tools/python.jam
>> 2. There, locate the following code:
>> if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT ) {
>>     # Prior to version 3.1.17 Boost Jam's SHELL command did not support
>>     # quoted commands correctly on Windows. This means that on that
>>     # platform we do not support using a Python command interpreter
>>     # executable whose path contains a space character.
>>     python-cmd = \"$(python-cmd)\" ;
>> }
>> 3. Remove that code block completely. </pre>
>> # Grab attachment:python26.def
>> # Copy c:\windows\System32\python26.dll to the same location as
>> attachment:python26.def # Execute: @dlltool --dllname python26.dll
>> --def python26.def --output-lib libpython26.a@ # Copy libpython26.a to
>> C:\Python26\libs # pre> bjam.exe --toolset=gcc --build-type=complete
>> --build-dir=C:\TEMP\boost_build\build
>> --stagedir=C:\TEMP\boost_build\stage -- address-model=64
>> define=BOOST_USE_WINDOWS_H threadapi=win32 target-os=windows stage
>> </pre> # Copy all files under C:\temp\boost_build\stage\lib to
>> c:\mingw64-i686-20110207\x86_64-w64-mingw32\lib64
>> # Copy C:\TEMP\boost_1_48_0\boost to
>> c:\mingw64-i686-20110207\x86_64-w64-mingw32\inlcude
>>
>> -----Original Message-----
>> From: cplusplus-sig-bounces+josh.davidson=[hidden email]
>> [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On
>> Behalf Of hbd666
>> Sent: Wednesday, December 21, 2011 2:24 AM
>> To: [hidden email]
>> Subject: EXTERNAL: [C++-sig] Building Boost Python problem
>>
>> 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\libbo
>> ost_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\libbo
>> ost_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\libbo
>> ost_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\libboos
>> t_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\libboos
>> t_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\libboos
>> t_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...
>>
>> _______________________________________________
>> Cplusplus-sig mailing list
>> [hidden email]
>> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
>
> _______________________________________________
> Cplusplus-sig mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/cplusplus-sig


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig