Results 1 to 2 of 2

Thread: QDomDocument createElement Segmentation Fault

  1. #1
    Join Date
    Nov 2019
    Qt products

    Default QDomDocument createElement Segmentation Fault

    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.

  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 863 Times in 850 Posts
    Qt products

    Default Re: QDomDocument createElement Segmentation Fault

    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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. a segmentation fault
    By yaohao@qtcentre in forum Qt Programming
    Replies: 4
    Last Post: 17th March 2011, 10:01
  2. Segmentation fault
    By Schimanski in forum Qt Programming
    Replies: 20
    Last Post: 31st August 2009, 17:26
  3. Segmentation fault
    By impeteperry in forum Qt Programming
    Replies: 5
    Last Post: 29th December 2008, 19:59
  4. segmentation fault
    By uchennaanyanwu in forum Newbie
    Replies: 3
    Last Post: 31st July 2008, 17:52
  5. Segmentation Fault
    By merry in forum General Programming
    Replies: 4
    Last Post: 12th March 2007, 05:08

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.