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. Segmentation error for simply HAVING a QVector in my class...
Forum Updated to NodeBB v4.3 + New Features

Segmentation error for simply HAVING a QVector in my class...

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 478 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.
  • J Offline
    J Offline
    Joezep
    wrote on last edited by
    #1

    Hello everybody and Merry Christmas.

    I am compiling my program with the Qt 5.4.2 MinGW 32 bit compiler and am having a bizarre issue at run time. I have a class with a private QVector <double> variable. I have of course included QVector.h in the preamble of my header.
    Whenever I try to create an instance of the class at rubtime, a segmentation fault occurs. If I run in debugger mode the debugger jumps to the following line in QVector.h:

        inline ~QVector() { if (!d->ref.deref()) freeData(d); }
    

    If I comment out the line where I declare my variable:

    QVector < double > PitchAngles;       //Blade pitch angle
    

    The program compiles and works without a problem. Most bizarre of all, I use many hundreds of instances of QVector in other classes in the program, and they work without a problem. I really don't understand what the problem could be.
    Any help is appreciated.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome
      I think we need more code around
      QVector < double > PitchAngles; //Blade pitch angle

      To give guesses.
      It does sounds odd.

      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