Results 1 to 10 of 10

Thread: vector causing system error/crash

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default vector causing system error/crash

    I am using vector in my code but when application is running it causes system error/crash.
    Code in .h file :
    Qt Code:
    1. #include <vector>
    2. using namespace std;
    3.  
    4. bool callVector(vector<float>&);
    5. void func();
    6.  
    7. vector <float> vectorname;
    To copy to clipboard, switch view to plain text mode 

    Code in .cpp file:
    Qt Code:
    1. void myClass::func()
    2. {
    3. if(!callVector(vectorname))
    4. {
    5. qDebug() << " vector error" ;
    6. }
    7. else
    8. {
    9. qDebug()<<"vector success" ;
    10. qDebug()<<"vector [0]" : << vectorname[0]; //**system error/crash HERE **
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 
    System error/crash at line 10 in .cpp.
    Application output:
    vector success
    .exe exited with code -1073741819
    Last edited by babygal; 11th October 2010 at 10:19.

Similar Threads

  1. Qt 4.7 SSE2 causing my app to crash
    By jonks in forum Qt Programming
    Replies: 8
    Last Post: 26th September 2010, 18:53
  2. QThread::wait() causing crash
    By Olliebrown in forum Qt Programming
    Replies: 3
    Last Post: 24th September 2010, 15:24
  3. Weird Windows Vista Permissions Causing Qmake Crash
    By CrazyIvanovich in forum Qt Programming
    Replies: 1
    Last Post: 4th June 2009, 21:52
  4. QTreeWidget->clear() causing crash after sort
    By Chuk in forum Qt Programming
    Replies: 7
    Last Post: 3rd September 2007, 09:59
  5. runtime error <vector>
    By mickey in forum General Programming
    Replies: 10
    Last Post: 5th September 2006, 12:18

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.