Open Devligue opened 6 years ago
Ok, problem solved and it is working now. I just had to install the missing parts of Qt and then add the lib directory to path.
But the configure.py script still needs some lifting in my view so I am leaving this open.
Recently I found myself in need to use SIP for wrapping some custom C++ Qt library and using it in python. Then I found this repository which looked very promising for my particular project. I have immediately tested code provided in this repo on Manjaro, with Python 3.6 and (Py)Qt 5.9 - no problems. Everything went smooth. But that was only for testing, because I need it to work on Windows 10. And here the problems begun...
My setup:
Problems with step one:
python configure.py
Since the newest versions of python like to install themselves inC:\Program Files (x86)
almost or all the paths that are added to cmd inconfigure.py
must be in quotes in order to work. The only exception wasconfig.sip_bin
which for whatever reason did throw error even in quotes, but since I hadsip
on my system path I have just omitted the full path and usedsip
.Then of course the known problem with
sip: Unable to find file "QtGui/QtGuimod.sip"
. I have managed to solve it with help of #1 so I will not elaborate on that.Finally, since there is no more MSVC 2010 available, we have to use VS2017 Community. Which means that the line
qmake_cmd += " -spec win32-msvc2010"
throws an error. Substitutingwin32-msvc2010
withwin32-msvc
,winrt-x86-msvc2015
orwinrt-x86-msvc2017
enabled me to move further (it did not throw an error) but I am still not sure whether it is correct and which should I use.Eventually the
python configure.py
did worked and it generated the makefile.Problems with step two:
make
I am not used to compiling stuff on windows, but as it appears windows usesnmake
instead ofmake
. I do not know how it was with MSVC 2010, but usingnmake
with VS 2017 turns out to be a bit tricky. First I had to runcmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
to enter the VS 2017 Developer Command Prompt and then I had to source the environment variables with"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
. As stated on Microsoft Forum "it is not a bug, it's a feature" and it is the only way to usenmake
. Eventually thenmake
command worked. But it throws an error:And here I am stuck with no idea how to proceed. I suppose that the
configure.py
is still not working properly and generates buggy makefiles. I have tried adding some additional paths to sip that will point to where Qt dlls are but with no luck. Here is how my sip cmd looks like this:sip -t WS_WIN -t Qt_5_9_2 -I "D:\Scripts\PyMyLabel-master\sip" -I "C:\Program Files (x86)\Python36-32\sip" -I "E:\Qt\5.9.1\mingw53_32\include" -I "E:\Qt\5.9.1\mingw53_32\lib" -I "C:\Program Files (x86)\Python36-32\include" -I "D:\Scripts\PyMyLabel-master\src" -c "D:\Scripts\PyMyLabel-master\modules" -b "D:\Scripts\PyMyLabel-master\modules\PyMyLabel.sbf" -w -o "D:\Scripts\PyMyLabel-master\sip\PyMyLabel.sip"
-I "E:\Qt\5.9.1\mingw53_32\include" -I "E:\Qt\5.9.1\mingw53_32\lib"
are the paths I have added but they change nothing.I am not experienced with this so I might be missing something obvious. It would be so great if you @jazzycamel could update this minimal SIP example repository for newer versions of Windows, Python, (Py)Qt, SIP and VS. As I mentioned at the beginning, on Linux it worked for me out of the box. Or please direct me on the right path on how to proceed. Thank you.