Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Class cannot be changed



  • Hi,

    i have some classes in my project and now i want to change one of them. The problem is: it's not possible, if i try to declare a new variable, i get a runtime-error. Every other class i can change. This is problem i also got when programming with MSVS. It's not even possible to add a simple integer value which doesn't do anything. But i can change other variables names and int->quint32 but not bool->int values. Any ideas?

    MfG akonshi



  • Hard to say with so little information.
    Did you perform a clean rebuild? (make clean; qmake; make)

    Are you sure the runtime error is causally linked to the changing of the memory structure of that class? How does that class look and how do you use it? Is it a shared library that must obey binary compatibility?



  • Paste a code please. Do you do correct initialization of new variables?



  • Hi,

    @#include "Starters.h"
    #include "Classes.h"
    #include <QPoint>

    class Map
    {
    private:
    bool Empty;
    bool Saved;

    public:
    Map(int w = iWIDTH, int h = iHEIGHT);
    ~Map();

    int WIDTH;
    int HEIGHT;
    int IslNum;
    
    MapA*** All;
    Island** Isls;
    
    void Generate();
    bool isEmpty() {return Empty;}
    void Build(QPoint& pos, const QString bt);
    QString s; // this is the line that doesn't works
    

    };@

    if i try to compile this, i get an error when creating a second instance of the class. Without this ****** line everything works fine. I already tried clean and stuff... BTW: Debug does not even work without line, only Release is possible.

    MfG akonshi


Log in to reply