CFFI 1.11.1 fails on Windows 7 with python 3.5.2 x64

Issue #338 resolved
Anonymous created an issue

Hello,

the new update from today (1.11.1) fails on Windows with python 3.5.2 with the follwing linker error

oss of data
    c:\users\tbam\appdata\local\temp\pip-build-ovv4dipl\cffi\c\cdlopen.c(352): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
    c:\users\tbam\appdata\local\temp\pip-build-ovv4dipl\cffi\c\call_python.c(90): warning C4244: 'function': conversion from 'intptr_t' to 'int', possible loss of data
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic/libffi_msvc -Ie:\conan_recipe\vtk\vtk-6.1.0\env\include "-IC:\Program Files\Python35\include" "-IC:\Program Files\Python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcc/libffi_msvc\ffi.c /Fobuild\temp.win-amd64-3.5\Release\c/libffi_msvc\ffi.obj
    ffi.c
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic/libffi_msvc -Ie:\conan_recipe\vtk\vtk-6.1.0\env\include "-IC:\Program Files\Python35\include" "-IC:\Program Files\Python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcc/libffi_msvc\prep_cif.c /Fobuild\temp.win-amd64-3.5\Release\c/libffi_msvc\prep_cif.obj
    prep_cif.c
    c/libffi_msvc\prep_cif.c(166): warning C4267: '+=': conversion from 'size_t' to 'unsigned int', possible loss of data
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic/libffi_msvc -Ie:\conan_recipe\vtk\vtk-6.1.0\env\include "-IC:\Program Files\Python35\include" "-IC:\Program Files\Python35\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcc/libffi_msvc\types.c /Fobuild\temp.win-amd64-3.5\Release\c/libffi_msvc\types.obj
    types.c
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:e:\conan_recipe\vtk\vtk-6.1.0\env\libs "/LIBPATH:C:\Program Files\Python35\libs" "/LIBPATH:C:\Program Files\Python35" /LIBPATH:e:\conan_recipe\vtk\vtk-6.1.0\env\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\um\x64" /EXPORT:PyInit__cffi_backend build\temp.win-amd64-3.5\Release\c/_cffi_backend.obj build\temp.win-amd64-3.5\Release\c/libffi_msvc\ffi.obj build\temp.win-amd64-3.5\Release\c/libffi_msvc\prep_cif.obj build\temp.win-amd64-3.5\Release\c/libffi_msvc\types.obj /OUT:build\lib.win-amd64-3.5\_cffi_backend.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\c\_cffi_backend.cp35-win_amd64.lib c/libffi_msvc\win64.obj
    _cffi_backend.obj : warning LNK4197: export 'PyInit__cffi_backend' specified multiple times; using first specification
       Creating library build\temp.win-amd64-3.5\Release\c\_cffi_backend.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\c\_cffi_backend.cp35-win_amd64.exp
    _cffi_backend.obj : error LNK2001: unresolved external symbol _PyThreadState_Current
    build\lib.win-amd64-3.5\_cffi_backend.cp35-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

It is a linker error:

error LNK2001: unresolved external symbol _PyThreadState_Current

Comments (9)

  1. Armin Rigo

    I have no idea how that is a duplicate of #339.

    This might show an issue that was always here with threads on Windows. I believe that the previous version of the code was incorrect in both Python 3.7a0 and on Windows. No clue why it still seems to compile and work fine on 32-bit Windows. Will investigate.

  2. Log in to comment