Tuesday, April 7, 2015

More Tuesday

Windows #3

So starting the Qt installation on Win7 and the Wizard wants to know what components to install. There is quite a lengthy list. It is easy to uncheck the ones related to Android and to Windows Phone. But there are at least 3 versions of OpenGL and at least 3 of Qt components. (I can't refer to the list right now because the wizard is busy downloading). All of these components note their compilers, e.g. MSC 2013 32-bit or such.

Now, I know this is a 64-bit Windows system. So I don't want any of the 32-bit things -- do I? But also, I know that it is supposed to be important for things that link to Python, that they use compatible run-times. I fire up Python and it says it is MSC 1600. Wut? Some DuckDuckGo lets me learn that this is equivalent to "MSVC 2010 (10.0 with msvcr100.dll runtime)". OK here's the thing, none of the components in the Qt install wizard list mention MSVC 2010, except one, and it's a 32-bit one.

Now what?

I install a random assortment based on guesswork. It finishes and automatically starts up Qt Creator, which doesn't come up but puts up an error dialog that is I swear to God, 500 words long, about how it can't find the OpenGL components it needs, do I have the right graphics drivers? and please make sure this, that, and the other thing are available on the PATH.

So obviously I chose wrongly.

So I run the wizard and tell it to remove all components. Will try this again.

Go to the qt.io download page, bypass the easy download-for-windows button, go to more downloads. OK, here is the list of available download packages for Windows:

    Qt 5.4.1 for Windows 64-bit (VS 2013, 722 MB)
    Qt 5.4.1 for Windows 64-bit (VS 2013, OpenGL, 711 MB)
    Qt 5.4.1 for Windows 32-bit (VS 2013, 705 MB)
    Qt 5.4.1 for Windows 32-bit (VS 2013, OpenGL, 695 MB)
    Qt 5.4.1 for Windows 32-bit (VS 2012, OpenGL, 644 MB)
    Qt 5.4.1 for Windows 32-bit (VS 2010, OpenGL, 627 MB)
    Qt 5.4.1 for Windows 32-bit (MinGW 4.9.1, 856 MB)
    Qt 5.4.1 for Android (Windows 32-bit, 939 MB)
    Qt 5.4.1 for Windows RT 32-bit (766 MB)

OK, one of the first two. But do I want the one with OpenGL or not? Given this is a Parallels VM, maybe it doesn't support OpenGL. OK. First one. While it downloads,

PyInstaller #2

On Ubuntu, the PyInstaller bundle "can't find platform plugin xcb". Well, libqxcb.so was in fact bundled, but not where the PyInstaller bootloader wants it. It (I think I blogged about this a few weeks ago) forces Qt5 plugins to the nonstandard folder qt5_plugins/platforms. No such directory in the current bundle, so clearly either the needed build-time hook didn't run, or isn't up to date. For the moment I finagle it manually creating qt5_plugins/platforms and move libqxcb into it. And hey, the symptom changes.

This issue will need to be revisited, to fix that hook. But now we have,

PyInstaller #3

Bundle fails because "ImportError: No module named 'mainwindow'". This seems unlikely. That's one of my modules which is imported by the top level program, PPQT2.py. OK, quickly resolved: there's a warning in the warning log, "no module named mainwindow". If that isn't imported, nothing of the rest of the program is imported. Because that imports book.py, which imports just about everything else. So that's a problem.

A problem two ways; it also means I have to re-run the PyInstaller build and that means I'll lose my hand-fixed libqxcb thing. So I need to fix that issue too.

Windows #3

Oh, hey, the Qt 700MB package is done downloading.

Much better; this wizard has a very short list of options, no multiple choices of compiler or whatever. So run it.

And oh, dear, same problem. When Qt Creator tries to come up, it creates the frame of its main window but only a dialog box "Welcome Mode Load Error - Failed to create OpenGL context for format QSurfaceFormat blah blah blah This is most likely caused by not having the necessary graphics drivers installed. Install a driver providing OpenGL 2.0 or higher, or blah blah blah."

I have no idea how to proceed from here.

Tomorrow's my day at the museum. Maybe I'll think of something by Thursday.

Edit:OK, so I did a quick duckduckgo on "install opengl in windows" and immediately found a forum post at the opengl site saying, no need, you already have it, just make sure your display driver is up to date."

That user then asked, "how I do that, eh?" and they said, "dxdiag in a console window." OK, so I did that and this nice program told me my graphics driver is Parallels. Of course it is, it's a Parallels VM. So then I searched on "parallels display adaptor opengl" and quickly found instructions from the Parallels site on how to change the configuration of a VM to enable OpenGL. One has to set on the configuration option "Enable 3D Acceleration". OK, that is not obviously OpenGL but whatever. I do that, reboot the VM, and hey hey! Qt Creator comes right up all happy! So that would be issue Windows #3 solved.

No comments: