PDA

View Full Version : QDomDocument createElement Segmentation Fault



scott bartolett
22nd November 2019, 22:15
I am getting a segmentation fault when calling QDomDocument::createElement. My code looks like this:

QDomDocument testDom;
QDomElement root = testDom.createElement("root");

I've also tried:

QDomDocument testDom("test");
QDomElement root = testDom.createElement("root");

I am using Qt5, and targeting Linux using VisualGDB CMake to build it. This code had previoulsy worked with Qt4 using QMake.

d_stranz
23rd November 2019, 04:25
There is nothing wrong with either of those code fragments.

What tools you use to build the executable are irrelevant. But, if you are compiling against Qt5 headers and libraries and your runtime is loading an incompatible version of the shared libraries, that could cause a crash.