Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with QXML
Forum Updated to NodeBB v4.3 + New Features

Problem with QXML

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Morphus
    wrote on last edited by
    #1

    Hello, I have been developing a qt application using msvc2010 and I rebuild qt using this config

    configure -platform win32-msvc2010 -debug -opensource -fast -plugin-sql-odbc -plugin-sql-sqlite -no-qt3support -no-dsp -incredibuild-xge -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -webkit -script -scripttools -qt-style-windowsxp -qt-style-windowsvista -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-s60 -nomake demos -nomake examples

    when I load a xml file, it's ok.
    @
    QFile file("item.xml");
    if (file.open(QIODevice::ReadOnly))
    {
    QDomDocument doc;
    if (doc.setContent(&file))
    {
    ...
    }
    file.close();
    }
    @
    but I have change the variable QMAKE_CFLAGS_DEBUG from MDd to MTd and the variable QMAKE_CFLAGS_RELEASE from MD to MT in the file "mkspecs/win32-msvc2010/qmake.conf" and rebuild qt again.

    Then, the code above will crash at doc.setContent(), and I found it crashes at line 1357 on qxml.cpp
    @
    1353 QXmlInputSource::~QXmlInputSource()
    1354 {
    1355 // ### Qt 5: close the input device. See task 153111
    1356 #ifndef QT_NO_TEXTCODEC
    1357 delete d->encMapper;
    1358 #endif
    1359 delete d;
    1360 }
    @
    Is there something else I need to do, or this is a bug of qt ?

    Any help?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      MD is a release mode setting. Use MDd (Multi threaded DLL debug). Don't mix MD and MDd. You'll get crashes.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Morphus
        wrote on last edited by
        #3

        [quote author="Franzk" date="1289283745"]MD is a release mode setting. Use MDd (Multi threaded DLL debug). Don't mix MD and MDd. You'll get crashes.[/quote]

        sorry, I made a mistake when I post, I build qt using MT/MTd instead of MD/MDd, and my project uses the same CRT library

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          Then make sure you link to the correct Qt libraries (debug and release libs should not be mixed up).

          Also try and find out what part of the delete statement actually causes the crash. Is it using the d pointer or is it actually deleting the member of the d pointer?

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cmzetes
            wrote on last edited by
            #5

            Hello,

            I see this is an old post, but I have exactly the same issue.
            It crashes on
            delete d->encMapper;

            Did you find a solution?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved