Results 1 to 5 of 5

Thread: Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

  1. #1
    Join Date
    Oct 2010
    Location
    Florida
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

    I just transitioned my Qt project from 4.7.0 to 4.8.0 on Windows (win32-g++). After fixing the "--enable-auto-import" issue in qmake.conf I am able to build. But trying to run, it crashes with the following error. "Microsoft Visual C++ Runtime Library" "Runtime Error!":

    error.png

    I don't even have Visual C++ installed. Same code runs perfectly in 4.7.0... Any help would be greatly appreciated.

    I have more data: The actual error is:

    ASSERT failure in QVector<T>::at: "index out of range", file ..\..\include/QtCore/../../src/corelib/tools/qvector.h, line 351

    This occurs when I attempt to drag a QTreeWidgetItem from a QTreeWidget. AND the QTreeWidget has been filtered to display a single QTreeWidgetItem. Here's (part of) the constructor for the QTreeWidget class:


    SourceTreeWidget::SourceTreeWidget(QWidget * parent):

    QTreeWidget(parent), actionRename(false), sourceSearchString(""),
    masterSearchString(""), sourceFiltered(false), masterFiltered(false),
    _lastFilePath(DEFAULT_FILE_PATH)
    {

    setObjectName("SourceTreeWidget");

    connect(this, SIGNAL(itemChanged(QTreeWidgetItem *, int)),
    this, SLOT(changeSourceName(QTreeWidgetItem *, int)));

    model()->setSupportedDragActions(Qt::CopyAction);
    .
    .
    .
    }
    Last edited by E099844; 28th September 2012 at 19:50. Reason: updated contents

  2. #2
    Join Date
    Oct 2010
    Location
    Florida
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

    I was finally able to catch the back trace from the debugger:


    0 ntdll!LdrAccessResource C:\WINDOWS\system32\ntdll.dll 0 0x7c90e514
    1 WaitMessage C:\WINDOWS\system32\user32.dll 0 0x7e419418
    2 USER32!CallMsgFilterW C:\WINDOWS\system32\user32.dll 0 0x7e42770a
    3 USER32!GetCursorFrameInfo C:\WINDOWS\system32\user32.dll 0 0x7e4249c4
    4 USER32!SoftModalMessageBox C:\WINDOWS\system32\user32.dll 0 0x7e43a956
    5 USER32!MessageBoxIndirectA C:\WINDOWS\system32\user32.dll 0 0x7e43a2bc
    6 USER32!MessageBoxTimeoutW C:\WINDOWS\system32\user32.dll 0 0x7e4663fd
    7 USER32!MessageBoxTimeoutA C:\WINDOWS\system32\user32.dll 0 0x7e4664a2
    8 USER32!MessageBoxExA C:\WINDOWS\system32\user32.dll 0 0x7e450877
    9 USER32!MessageBoxA C:\WINDOWS\system32\user32.dll 0 0x7e45082f
    10 strerror C:\WINDOWS\system32\msvcrt.dll 0 0x77c39300
    11 msvcrt!_lock C:\WINDOWS\system32\msvcrt.dll 0 0x77c3b127
    12 msvcrt!abort C:\WINDOWS\system32\msvcrt.dll 0 0x77c36bba
    13 ?? qlist.h 395 0xa
    14 qt_message qglobal.cpp 2298 0x6a10f18a
    15 qFatal qglobal.cpp 2481 0x6a10f57a
    16 qt_assert_x qglobal.cpp 2007 0x6a10ebcc
    17 QVector<QTreeViewItem>::at qvector.h 351 0x43f7a67
    18 QTreeViewPrivate::adjustViewOptionsForIndex qtreeview.cpp 1386 0x415ce9c
    19 QAbstractItemViewPrivate::renderToPixmap qabstractitemview.cpp 4241 0x412f56b
    20 QAbstractItemView::startDrag qabstractitemview.cpp 3529 0x412c6f9
    21 QAbstractItemView::mouseMoveEvent qabstractitemview.cpp 1725 0x4125367
    22 QTreeView::mouseMoveEvent qtreeview.cpp 1939 0x415fc2a
    23 QWidget::event qwidget.cpp 8346 0x3c763a2
    24 QFrame::event qframe.cpp 557 0x400a5b8
    25 QAbstractScrollArea::viewportEvent qabstractscrollarea.cpp 1043 0x409950f
    26 QAbstractItemView::viewportEvent qabstractitemview.cpp 1644 0x4124b6d
    27 QTreeView::viewportEvent qtreeview.cpp 1257 0x415c8f7
    28 QAbstractScrollAreaPrivate::viewportEvent qabstractscrollarea_p.h 100 0x42fbd23
    29 QAbstractScrollAreaFilter::eventFilter qabstractscrollarea_p.h 116 0x42fa0e4
    30 QCoreApplicationPrivate::sendThroughObjectEventFil ters qcoreapplication.cpp 986 0x6a21348
    31 QApplicationPrivate::notify_helper qapplication.cpp 4546 0x3c2bfff
    32 QApplication::notify qapplication.cpp 4093 0x3c2a26a
    33 QCoreApplication::notifyInternal qcoreapplication.cpp 876 0x6a213252
    34 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 234 0x42c0246
    35 QApplicationPrivate::sendMouseEvent qapplication.cpp 3159 0x3c28ad6
    36 QETWidget::translateMouseEvent qapplication_win.cpp 3363 0x3c93171
    37 QtWndProc qapplication_win.cpp 1696 0x3c8df66
    38 USER32!GetDC C:\WINDOWS\system32\user32.dll 0 0x7e418734

  3. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

    you cant mix and match compilers. Qt has to be built with the same compiler as that with which your app is built.

    the (release) run time library is a re-distributable and has virtually nothing to do with having/not having studio installed.

    Also make sure you are linking consistently to all debug or all release libraries.
    Last edited by amleto; 28th September 2012 at 20:36.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  4. #4
    Join Date
    Oct 2010
    Location
    Bangalore
    Posts
    52
    Thanks
    8
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

    ASSERT failure in QVector<T>::at: "index out of range", file ..\..\include/QtCore/../../src/corelib/tools/qvector.h, line 351

    In your code if your using QVector the problem is vector is not filled and you are accessing that which means
    the vector size is zero . without filling vector if you access m_nvector.at(0) then "vector index out of range " it will show and program will crash ..
    once again check your code if your are using Qvector in your code .

    eg:
    Qt Code:
    1. if(m_nvector.size()
    2. m_nvector.at(0)
    To copy to clipboard, switch view to plain text mode 

    try this where ever you are using vector I hope this will solve your problem ....

  5. #5
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Why Microsoft Visual C++ Runtime Library error in Qt 4.8.0 using win32-g++

    you can see from the call stack that the QVector instance that asserts is a Qt private implementation instance so what you suggest won't help here.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. visual studio runtime error on qml-qt interaction
    By vinayaka in forum Qt Programming
    Replies: 0
    Last Post: 2nd June 2011, 13:06
  2. Replies: 0
    Last Post: 27th May 2011, 11:13
  3. Microsoft Visual C++- Runtime Library Error while deploying Qt Application
    By mammaiap in forum Installation and Deployment
    Replies: 1
    Last Post: 7th May 2011, 00:41
  4. Replies: 1
    Last Post: 25th September 2010, 08:20
  5. Replies: 2
    Last Post: 23rd November 2007, 17:44

Bookmarks

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.