Skip to content

Windows prebuilt binaries v1.64.0: boost-python3 is linked against python27.dll #129

Closed

Description

@krf

Installer from: https://sourceforge.net/projects/boost/files/boost-binaries/1.64.0/boost_1_64_0-msvc-14.0-64.exe/download

When linking against boost-python3, compilation fails since boost-python3 pulls in Python 2.7 instead of Python 3.x:

foo.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct _object * __cdecl boost::python::detail::init_module(struct PyModuleDef &,void (__cdecl*)(void))" (__imp_?init_module@detail@python@boost@@YAPEAU_object@@AEAUPyModuleDef@@P6AXXZ@Z) referenced in function PyInit_window

..\bin\foolib.dll : fatal error LNK1120: 1 unresolved externals
C:\>dumpbin /dependents C:\local\boost_1_64_0\lib64-msvc-14.0\boost_python3-vc140-mt-1_64.dll
Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\local\boost_1_64_0\lib64-msvc-14.0\boost_python3-vc140-mt-1_64.dll

File Type: DLL

  Image has the following dependencies:

    python27.dll
    MSVCP140.dll
    KERNEL32.dll
    VCRUNTIME140.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll

  Summary

        3000 .data
        1000 .gfids
        3000 .pdata
       1E000 .rdata
        1000 .reloc
        1000 .rsrc
       24000 .text
        1000 .tls

Activity

  1. stefanseefeld commented on Jun 27, 2017

    @stefanseefeld
    Member

    Would you please try the current develop or master (at this point they are the same) and report whether this is still an issue ? Thanks !

  2. nickdademo commented on Aug 25, 2017

    @nickdademo

    I'm getting the same problem with boost_1_65_0-msvc-14.0-64, so I guess this problem still exists...

    dumpbin /dependents boost_python-vc140-mt-1_65.dll
    
    Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file boost_python-vc140-mt-1_65.dll
    
    File Type: DLL
    
      Image has the following dependencies:
    
        python27.dll
        MSVCP140.dll
        KERNEL32.dll
        VCRUNTIME140.dll
        api-ms-win-crt-runtime-l1-1-0.dll
        api-ms-win-crt-heap-l1-1-0.dll
    
      Summary
    
            3000 .data
            1000 .gfids
            3000 .pdata
           1B000 .rdata
            1000 .reloc
            1000 .rsrc
           22000 .text
            1000 .tls
    

    Edit: boost_python3-vc140-mt-1_65.dll also links to Python 2.7.

  3. stefanseefeld commented on Aug 25, 2017

    @stefanseefeld
    Member

    Thanks for the report; I can confirm that. However, I can't reproduce the problem by building Boost.Python myself. I'll try to figure out who "owns" the process of building the Windows binaries.
    Meanwhile, I suggest building Boost (or at least Boost.Python) from source.

  4. garyfurnish commented on Aug 25, 2017

    @garyfurnish
    Contributor

    I also didn't reproduce this a few days ago.

  5. nickdademo commented on Aug 25, 2017

    @nickdademo

    Looks like my only option currently is to build from source as you suggest Stefan.

    I assume the dependency to Python 2.7 in boost_python3-vc140-mt-1_65.dll is indeed a mistake? I wonder how Boost.Python is working for others with the same setup.

  6. stefanseefeld commented on Aug 25, 2017

    @stefanseefeld
    Member
  7. nickdademo commented on Aug 27, 2017

    @nickdademo

    Just a quick follow-up - as expected, building the Boost.Python library from source fixed the issue:

    
    dumpbin /dependents boost_python3-vc140-mt-1_65.dll
    
    Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file boost_python3-vc140-mt-1_65.dll
    
    File Type: DLL
    
      Image has the following dependencies:
    
        python36.dll
        MSVCP140.dll
        KERNEL32.dll
        VCRUNTIME140.dll
        api-ms-win-crt-runtime-l1-1-0.dll
        api-ms-win-crt-heap-l1-1-0.dll
    
      Summary
    
            3000 .data
            1000 .gfids
            3000 .pdata
           1B000 .rdata
            1000 .reloc
            1000 .rsrc
           21000 .text
            1000 .tls
    
  8. yoons1 commented on Sep 12, 2017

    @yoons1

    Python27 still dependent in the 1.65.1 pre-built:

    dumpbin /dependents boost_python3-vc140-mt-1_65_1.dll

    Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
    Copyright (C) Microsoft Corporation. All rights reserved.

    Dump of file boost_python3-vc140-mt-1_65_1.dll

    File Type: DLL

    Image has the following dependencies:

    python27.dll
    MSVCP140.dll
    KERNEL32.dll
    VCRUNTIME140.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    
  9. nickdademo commented on Dec 8, 2017

    @nickdademo

    Another update: 1.66 still has this issue.

    dumpbin /dependents boost_python3-vc140-mt-x64-1_66.dll
    Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file boost_python3-vc140-mt-x64-1_66.dll
    
    File Type: DLL
    
      Image has the following dependencies:
    
        python27.dll
        MSVCP140.dll
        KERNEL32.dll
        VCRUNTIME140.dll
        api-ms-win-crt-runtime-l1-1-0.dll
        api-ms-win-crt-heap-l1-1-0.dll
    
      Summary
    
            3000 .data
            1000 .gfids
            3000 .pdata
           1B000 .rdata
            1000 .reloc
            1000 .rsrc
           22000 .text
            1000 .tls
    
  10. stefanseefeld commented on Dec 8, 2017

    @stefanseefeld
    Member

    I managed to trace the problem back to its (very likely) cause, and reported it to the Boost.Build ML: https://lists.boost.org/boost-build/2017/12/29715.php
    Let's see what the Boost.Build folks have to say about this.

  11. prasadghole commented on Jan 23, 2018

    @prasadghole

    It seems if we compare dumpbin output of boost_python-vc141-mt-1_64.dll boost_python3-vc141-mt-1_64.dll both are matching. Means file available on precompiled sourceforge are same.

  12. stefanseefeld commented on Jan 23, 2018

    @stefanseefeld
    Member

    @prasadghole , indeed. See my last comment (and the link to the related discussion) for explanations.

  13. stefanseefeld commented on Apr 9, 2018

    @stefanseefeld
    Member

    The fix is in develop, and should find its way into the 1.67 release. Please open a new issue if that's not the case. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions