Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Building pyside2 on Windows 10 VS2017



  • Hello everyone,

    I'm trying to build pyside2 following the instructions detailed here.

    I hae vs2017 community installed and also the vs2015 tools. I have all the requirements installed.

    • CMake 3.12.2
    • Python 3.6.6
    • clang 7.0
    • Qt 5.11.1

    First, to actually build pyside 2 using the command line suggested

    python setup.py build --qmake=E:\Qt\5.11.1\msvc2015_64\bin\qmake.exe --openssl=C:\Dev\qtdev\OpenSSL-Win64\bin  --build-tests --ignore-git --jobs=8
    

    I had to run it from VS2017 command prompt. Because otherwise 'cl' wasn't found. Also I had to remove the "jobs" option, and install the "wheel" module for python 3.

    The compilation starts, and on the linking process for apiextractor.lib, I have a lot linker errors due to xslt and xml2 for instance (spanish in between... sorry):

    apiextractor.lib(docparser.cpp.obj) : error LNK2019: smbolo externo xmlCleanupParser sin resolver al que se hace referencia en la funcin "public: __cdecl `anonymous namespace'::XslResources::~XslResources(void)" (??1XslResources@?A0xa8359506@@QEAA@XZ)
    

    I have gnuwin32 installed, and at the end of the process I get:

    C:\gnuwin32\lib\libxslt.lib : warning LNK4272: el tipo de mquina de biblioteca 'x86' est en conflicto con el tipo de mquina de destino 'x64'
    

    Ok, libraries are not 64 bit... I get it. But I havent been able to find .lib files for windows x64.

    When I try to compile using cmake and vs2017 and I use 64 bit libraries for xlm2 and xslt (.a files) I got a lot of errors of not defined symbols when compiling shiboken.exe (apiextractor and libshiboken compile just fine). For instance:

    1>libxml2.a(xmlregexp.o) : error LNK2001: símbolo externo __imp___iob_func sin resolver
    

    I've struggling with this for 2 days now... any help will be very much appreciated.

    Regards.

    EDIT:

    Ok... I removed my gnuwin32 (and cygwin32-64) installation from my system path and the above linking errors dissapear.

    After this, shiboken2 was successfully compiled (both, from console and cmake-gui+vs2017 gui), but now I have problems compiling the "QtCore" component for pyside2. I have the same linking error (console and guis):

    Console output:

    [ 12%] Linking CXX shared module ..\QtCore.cp36-win_amd64.pyd
    LINK: command "C:\PROGRA~2\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\QtCore.dir\objects1.rsp /out:..\QtCore.cp36-win_amd64.pyd /implib:QtCore.cp36-win_amd64.lib /pdb:C:\Users\dhabbyc\Desktop\DEV\pyside-setup\pyside3_build\py3.6-qt5.11.1-64bit-release\pyside2\PySide2\QtCore.cp36-win_amd64.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO ..\..\libpyside\pyside2.cp36-win_amd64.lib C:\Python36\libs\python36.lib C:\Users\dhabbyc\Desktop\DEV\pyside-setup\pyside3_install\py3.6-qt5.11.1-64bit-release\lib\shiboken2.cp36-win_amd64.lib C:\Qt5\5.11.1\msvc2015_64\lib\Qt5Qml.lib C:\Qt5\5.11.1\msvc2015_64\lib\Qt5Network.lib C:\Qt5\5.11.1\msvc2015_64\lib\Qt5Core.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:..\QtCore.cp36-win_amd64.pyd.manifest" failed (exit code 1120) with the following output:
       Creando biblioteca QtCore.cp36-win_amd64.lib y objeto QtCore.cp36-win_amd64.exp
    qbasicmutex_wrapper.cpp.obj : error LNK2019: smbolo externo "__declspec(dllimport) public: __cdecl QBasicMutex::QBasicMutex(void)" (__imp_??0QBasicMutex@@QEAA@XZ) sin resolver al que se hace referencia en la funcin Sbk_QBasicMutex_Init
    ..\QtCore.cp36-win_amd64.pyd : fatal error LNK1120: 1 externos sin resolver
    NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : cdigo devuelto '0xffffffff'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX64\x64\nmake.exe"' : cdigo devuelto '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX64\x64\nmake.exe"' : cdigo devuelto '0x2'
    Stop.
    error: Error compiling pyside2
    

    EDIT2:
    I created a fresh Windows 10 machine with visual studio community 2017 (with and without the 2015 toolset) and installed all recommended versions of the requirements, and still have the same problem.

    Does anyone had success building pyside2 using the official instruccions for windows 10 with visual studio 2017 community??

    Any ideas?



  • Did you make any progress with this? I think I've got a similar issue.



  • Hi,

    No I haven't. But I have not tried again since pyside2 is officcially supported.



  • @dhabbyc said in Building pyside2 on Windows 10 VS2017:

    pyside2 is officcially supported

    Given that, could it be possible you mark your post as solved? Thanks.


Log in to reply