Building Libs for Windows Debug Version with VS2017/Qt5.12

Having trouble installing or compiling FreeCAD? Get help here.
Post Reply
User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Thu Mar 07, 2019 9:19 am

Hi all,
i am still trying to compile FC from source with VS2017 in debug mode.
Compiling works and now it comes to run FC. When using the PySide wrapper to load PySide2 i get the following problem:

When WidgetFactory.cpp wants to loads the modules PySide2.QtCore,PySide2.QtGui,PySide2.QtWidgets, shiboken can load the modules and returns a valid PyObject in WidgetFactory.cpp line 445 (valid means not a null ptr). But in line 449 shiboken tries to get the types from the PyObject (Shiboken::Module::getTypes), but this returns a null pointer.
This happens also when loading PySide2.QtCore and PySide2.QtWidgets.
Does someone has an idea?

BR Manuel
Last edited by apeltauer on Thu Mar 07, 2019 1:05 pm, edited 1 time in total.

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Windows PySide2 / Shiboken / Qt5.12

Post by apeltauer » Thu Mar 07, 2019 1:02 pm

Solved the Problem. It was a debug/release miss match while building pyside with python.exe and python_d.exe.

Fc starts now without any errors. But now I am facing the next problem.
I rename the topic to track all my experience building the debug libs.

Next problem:
When starting the draft GUI, the icons have no image. Or at least the snapping tool does not.
Running the Draft Tests fails with an access violation in the pivy wrapper.... Null Pointer...

Br Manuel

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Fri Mar 08, 2019 12:17 pm

Running the test probably fail because the whole Coin3d stuff does not work.
Right now i get the following error message when trying to create a new document:

Must have a current GL context when instantiating cc_glglue!! (Note: if you are using an old Mesa GL version, set the environment variable COIN_GL_NO_CURRENT_CONTEXT_CHECK to get around what may be a Mesa bug.)

It comes from gl.cpp from the coin source. I have already build coin with superglu but the same result.
Does someone know this issue on windows?

BR Manuel

PS: Running on Windows10 with the latest Nvidia Driver for a GTX-1080

wmayer
Site Admin
Posts: 14892
Joined: Thu Feb 19, 2009 10:32 am

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer » Fri Mar 08, 2019 12:56 pm

Running the test probably fail because the whole Coin3d stuff does not work.
IMO this is caused by a different behaviour in Qt 5.12. I guess the only way is to test it with an older Qt version (e.g. Qt 5.9 still works) and for both versions debug through the Qt source code to find out what exactly is different. Maybe this way you can find out a workaround to make it working again.

FYI, several weeks ago I had tmp. access to a system where VS 2017 was installed and using Qt 5.12 I had the same problems. Switching back to Qt 5.9 did the trick. Unfortunately, I hadn't the chance to look deeper why Qt 5.12 is causing problems.

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Fri Mar 08, 2019 1:06 pm

Thanks Werner for the hint. You save me a lot of debbuging time!
I will later try with the older qt version for now. If it works I can continue with all the other libs and later try to switch to Qt 5.12....

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Sat Mar 09, 2019 2:00 pm

After digging around i found out that going back to an older qt version may a bad idea. PySide2 is official release with qt 5.11. Going back to Qt 5.9 brings some other difficulties. The building script just works with python 3.6....
After searching the internet how to get coin3d and qt 5.12 to work i just found a discussion (https://groups.google.com/forum/#!topic ... yP2qNN_Osw) the descriped option works to get the error a way. But like everything, one error is gone the next is there....

Now Qt throws the following error when creating a new document:
ASSERT failure in QVector<T>::operator[]: "index out of range", file c:\users\qt\work\qt\qtbase\include\qtcore\../../src/corelib/tools/qvector.h, line 433
I dont see any error in the fc source code.....
See my call stack:
Capture.PNG
Capture.PNG (43.21 KiB) Viewed 1221 times
Capture^2.PNG
Capture^2.PNG (46.91 KiB) Viewed 1221 times
Now i am trying to get the qt source and debug symbols to go in the source code....
Maybe someone has an other idea?
wmayer, maybe?

BR Manuel

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Sat Mar 09, 2019 3:17 pm

Update:
Working with Teamviewer on my desktop pc just works fine! There is no problem to create a scene and add parts...
Seems that it is a opengl over rdp problem. I found couple of discussions in the internet about this....
BTW: In the past i have discovered that over remote desktop the rendering does not work so well....

Maybe some one can test this too and can tell us his/her experience...

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Sat Mar 09, 2019 6:22 pm

Update:
I cant figure out why my python to coin binding does not work.
I use swig version 3.0.10.
It always throws an exception in python_d.dll after the call comes from swigpyrun.h in line 2484.

Code: Select all

inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
when creating

Code: Select all

SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
The exceptions comes from here:

Code: Select all

excess_args(PyObject *args, PyObject *kwds)
{
    return PyTuple_GET_SIZE(args) ||
        (kwds && PyDict_Check(kwds) && PyDict_GET_SIZE(kwds));
}
I can reproduce this when running

Code: Select all

sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
Does someone can help me out?

My next step would be using an older swig version, any recommendation which version could work?

BR Manuel

wmayer
Site Admin
Posts: 14892
Joined: Thu Feb 19, 2009 10:32 am

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer » Sat Mar 09, 2019 6:59 pm

Did you build pivy with the same swig version as you generated the file swigpyrun.h?

User avatar
apeltauer
Posts: 212
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer » Sat Mar 09, 2019 7:06 pm

Yes, i have build pivy with same swig.

Post Reply