Random errors have started to pop up

  • Hi All,
    I'm suddenly scratching my head about some issues I'm having. I'm worried that something is broken somewhere and I can't see where. What happened. Firstly a piece of code I haven't touched for weeks reported an error with a signal slot.

    emit LineObject.resize();

    line_class.h:92: error: 'void Line_Class::resize()' is protected
    void resize( void );
    opensave_gamefile.cpp:741: error: within this context
    emit LineObject.resize();

    So just for a test I though I would delete the emit line, I did, I then go an error from a simple string

    std::string send = "message";

    I get the error

    game_objectclass.cpp:476: error: 'to_string' is not a member of 'std'
    std::string send = "message"

    So I deleted the string message, I then get 100's of errors such as
    client.cpp:448: error: 'stoi' is not a member of 'std'
    Control_Object.position( realps, std::stoi ( value, nullptr, 10 ) );
    It's as if it doesn't see c++ anymore :s can anyone advise please?

  • On testing further, some of these issues seem to be related to c11

    client.cpp:448: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
              Control_Object.set_position( realps, std::stoi ( value, nullptr, 10 ) );

    However I can see ( and I've never changed my pro file ) it also says

    CONFIG += c++11

    can .pro ignore config?

  • Lifetime Qt Champion


    What OS/Compiler/Qt combo are you using ?

    emit LineObject.resize(); ? That's bad, don't try to emit signals from other objects.

  • Hi Using Linux Lubuntu 15.04 QT 3.1.1
    But the code has always worked, for months. It was working last night until suddenly it broke. Everytime I comment out an error a new set of errors appear, until I finally reach c11 stuff.
    So I comment out the emit, the slot and the connect function and it then reports that "to_string" is not in "std" even though I have config pointing to c11 in my .pro? If I take out the "to_string" line I get dozens of errors in my code all to do with c11.
    I've tried rebuild, runqmake ect nothing fixes :s

  • Found issue. Somehow Qt had revered to using qt4.8... I found this by checking through everything noticed in in tool->options. So set my project to 5.3 qmake and it's now compiling. However have some other issues popping up.

    How is it even possible for project setting to jump back to an old version of qt...

  • Lifetime Qt Champion

    That I don't know, however you are running a pretty old version of Qt Creator. I'd recommend updating it. 4.0.0 is almost out.

Log in to reply