Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt6.5.3 and QTcreator 9 .... problem to use gcc-9
Forum Updated to NodeBB v4.3 + New Features

Qt6.5.3 and QTcreator 9 .... problem to use gcc-9

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
23 Posts 6 Posters 3.9k 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.
  • gfxxG gfxx

    I realize now .... after error about flag I've everytime an error related with somme xxxxxx.o file ..... and everytime these file have and xxxxx.ui .... and normally it is QDialog or utilize some QGraphicView or QSqlDatabase ..... so maybe porting qt5.15 to Qt6.5 somethings in QGraphicViews or QSqlDatabase is not accept ...... anyone can indicate me what normally is not accept when it is done these type of porting?

    Pl45m4P Offline
    Pl45m4P Offline
    Pl45m4
    wrote on last edited by
    #3

    @gfxx

    See changes to QtCharts module here:

    • https://doc.qt.io/qt-6/qtcharts-changes-qt6.html
    1. After these see on new app qt6.5 use cmake instead .pro file .... but is possible to use .pro file as in the past or need to convert all an cmake ???

    Yes, you still can use QMake in Qt6. The recommended build system however is CMake.


    If debugging is the process of removing software bugs, then programming must be the process of putting them in.

    ~E. W. Dijkstra

    1 Reply Last reply
    1
    • gfxxG Offline
      gfxxG Offline
      gfxx
      wrote on last edited by gfxx
      #4

      @Pl45m4 thanks for these ......

      @ all .....

      after try to compile and debug several time .... maybe there are ana error in these file but compiler non suggest nothing of interesting ... only WLED.0 error 1 ...

      WLED.h file *********

      #ifndef _WLED_H_
      #define _WLED_H_
      
      #include <QtDesigner/QtDesigner>
      #include <QWidget>
      
      class QTimer;
      
      class QDESIGNER_WIDGET_EXPORT WLED : public QWidget
      {
      	Q_OBJECT
      
      	Q_PROPERTY(double diameter READ diameter WRITE setDiameter) // mm
      	Q_PROPERTY(QColor color READ color WRITE setColor)
      	Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
      	Q_PROPERTY(bool state READ state WRITE setState)
      	Q_PROPERTY(bool flashing READ isFlashing WRITE setFlashing)
      	Q_PROPERTY(int flashRate READ flashRate WRITE setFlashRate)
      
      public:
          explicit WLED(QWidget* parent=0);
          ~WLED();
      
      	double diameter() const;
      	void setDiameter(double diameter);
      
      	QColor color() const;
      	void setColor(const QColor& color);
      
      	Qt::Alignment alignment() const;
      	void setAlignment(Qt::Alignment alignment);
      
          bool state() const;
      
          bool isFlashing() const;
          
          int flashRate() const;
      
      public slots:
      	void setState(bool state);
      	void toggleState();
      	void setFlashing(bool flashing);
      	void setFlashRate(int rate);
      	void startFlashing();
      	void stopFlashing();
      
      public:
      	int heightForWidth(int width) const;
      	QSize sizeHint() const;
      	QSize minimumSizeHint() const;
      
      signals:
          void setStateSig(bool state);
          void setNOTStateSig(bool state);
          void setFlashingSig(bool flashing);
          void setFlashRateSig(int rate);
      
      protected:
      	void paintEvent(QPaintEvent* event);
      
      private:
      	double diameter_;
      	QColor color_;
      	Qt::Alignment alignment_;
      	bool initialState_;
      	bool state_;
      	int flashRate_;
      	bool flashing_;
      
      	//
      	// Pixels per mm for x and y...
      	//
      	int pixX_, pixY_;
      
      	//
      	// Scaled values for x and y diameter.
      	//
      	int diamX_, diamY_;
      
      	QRadialGradient gradient_;
      	QTimer* timer_;
      };
      
      #endif
      
      

      than WLED.ccp file ***********

      code_text
      ```#include <math.h>
      
      #include <QPainter>
      #include <QGradient>
      #include <QPaintDevice>
      #include <QTimer>
      
      #include "WLED.h"
      
      WLED::
      WLED(QWidget* parent) :
      	QWidget(parent),
      	diameter_(5),
      	color_(QColor("red")),
      	alignment_(Qt::AlignCenter),
      	initialState_(true),
      	state_(true),
      	flashRate_(200),
      	flashing_(false)
      {
      	timer_ = new QTimer(this);
      	connect(timer_, SIGNAL(timeout()), this, SLOT(toggleState()));
      
          setDiameter(diameter_);
      }
      
      WLED::
      ~WLED()
      {
      }
      
      
      double WLED::
      diameter() const
      {
      	return diameter_;
      }
      
      void WLED::
      setDiameter(double diameter)
      {
      	diameter_ = diameter;
      
      	pixX_ = round(double(height())/heightMM());
      	pixY_ = round(double(width())/widthMM());
      
      	diamX_ = diameter_*pixX_;
      	diamY_ = diameter_*pixY_;
      
      	update();
      }
      
      
      QColor WLED::
      color() const
      {
      	return color_;
      }
      
      void WLED::
      setColor(const QColor& color)
      {
      	color_ = color;
      	update();
      }
      
      Qt::Alignment WLED::
      alignment() const
      {
      	return alignment_;
      }
      
      void WLED::
      setAlignment(Qt::Alignment alignment)
      {
      	alignment_ = alignment;
      
      	update();
      }
      
      void WLED::
      setFlashRate(int rate)
      {
      	flashRate_ = rate;
          emit setFlashRateSig(rate);
      
      	update();
      }
      
      void WLED::
      setFlashing(bool flashing)
      {
      	flashing_ = flashing;
          emit setFlashingSig(flashing);
      
      	update();
      }
      
      void WLED::
      startFlashing()
      {
      	setFlashing(true);
      }
      
      void WLED::
      stopFlashing()
      {
      	setFlashing(false);
      }
      
      
      void WLED::
      setState(bool state)
      {
      	state_ = state;
          emit setStateSig(state);
          emit setNOTStateSig(!state);
      	update();
      }
      
      void WLED::
      toggleState()
      {
      	state_ = !state_;
      	update();
      }
      
      int WLED::
      heightForWidth(int width) const
      {
      	return width;
      }
      
      QSize WLED::
      sizeHint() const
      {
      	return QSize(diamX_, diamY_);
      }
      
      QSize WLED::
      minimumSizeHint() const
      {
      	return QSize(diamX_, diamY_);
      }
      
      void WLED::
      paintEvent(QPaintEvent *event)
      {
          Q_UNUSED(event);
      
      	QPainter p(this);
      
      	QRect geo = geometry();
      	int width = geo.width();
      	int height = geo.height();
      
      	int x=0, y=0;
      	if ( alignment_ & Qt::AlignLeft )
      		x = 0;
      	else if ( alignment_ & Qt::AlignRight )
      		x = width-diamX_;
      	else if ( alignment_ & Qt::AlignHCenter )
      		x = (width-diamX_)/2;
      	else if ( alignment_ & Qt::AlignJustify )
      		x = 0;
      
      	if ( alignment_ & Qt::AlignTop )
      		y = 0;
      	else if ( alignment_ & Qt::AlignBottom )
      		y = height-diamY_;
      	else if ( alignment_ & Qt::AlignVCenter )
      		y = (height-diamY_)/2;
      
      	QRadialGradient g(x+diamX_/2, y+diamY_/2, diamX_*0.4,
      		diamX_*0.4, diamY_*0.4);
      
      	g.setColorAt(0, Qt::white);
      	if ( state_ )
      		g.setColorAt(1, color_);
      	else
      		g.setColorAt(1, Qt::black);
      	QBrush brush(g);
      
      	p.setPen(color_);
      	p.setRenderHint(QPainter::Antialiasing, true);
      	p.setBrush(brush);
      	p.drawEllipse(x, y, diamX_-1, diamY_-1);
      
      	if ( flashRate_ > 0 && flashing_ )
      		timer_->start(flashRate_);
      	else
      		timer_->stop();
      }
      
      bool WLED::
      state() const
      {
          return state_;
      }
      
      bool WLED::
      isFlashing() const
      {
          return flashing_;
      }
          
      int WLED::
      flashRate() const
      {
          return flashRate_;
      }
      
      

      not understand why in qt5.15 compile ok and in qt6.5 not so good .... previosly obviusly compiler was gcc-7 ... actually try to use gcc-9 .... but compiler everytime show to me these row:

      Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
      Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
      If this causes problems, reconfigure your locale. See the locale(1) manual
      for more information.
      
      /** other messages about compiling "blue colour" ***/
      
      See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
      make: *** [Makefile:7513: WLED.o] Error 1
      

      so seems not accept to use gcc-9 and still use gcc-12 ..... how can "obligate qtcreator to use gcc-9 instead use standard debian12 gcc-12??

      may be problem was these for first and only after other see from compilers ....

      bkt

      1 Reply Last reply
      0
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #5

        Just read the documentation.
        Start with the supported compilers per platform.
        Continue with how to add a compiler to Qt Creator.
        Choose that compiler in your kit. You may have to delete your binary tree and build from scratch, if the compiler has changed.

        Software Engineer
        The Qt Company, Oslo

        gfxxG 1 Reply Last reply
        0
        • Axel SpoerlA Axel Spoerl

          Just read the documentation.
          Start with the supported compilers per platform.
          Continue with how to add a compiler to Qt Creator.
          Choose that compiler in your kit. You may have to delete your binary tree and build from scratch, if the compiler has changed.

          gfxxG Offline
          gfxxG Offline
          gfxx
          wrote on last edited by
          #6

          @Axel-Spoerl Thanks a lot ... all done ....but when have an error seems compiler still gcc12 instead gcc9 that is better for creator 9 or 14 ..... error messages refer everytime to "..../gcc-12/...."

          bkt

          jsulmJ 1 Reply Last reply
          0
          • gfxxG gfxx

            @Axel-Spoerl Thanks a lot ... all done ....but when have an error seems compiler still gcc12 instead gcc9 that is better for creator 9 or 14 ..... error messages refer everytime to "..../gcc-12/...."

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #7

            @gfxx Make sure you really set the correct compiler and then do a complete rebuild.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            gfxxG 1 Reply Last reply
            0
            • jsulmJ jsulm

              @gfxx Make sure you really set the correct compiler and then do a complete rebuild.

              gfxxG Offline
              gfxxG Offline
              gfxx
              wrote on last edited by
              #8

              @jsulm ..... because quite newbe on these attach some image .... maybe I can understand better your suggestions ...
              1- System info from QtCreator
              system-info.png

              2- gcc version avaiable and detect
              gcc-installed.png

              3- Changing gcc versions
              chenge-gcc-version.png

              4- after compiling obtain new error ... seems refer to gcc12 .... i'm in wrong?
              error-referred-gcc12.png

              best regards

              bkt

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #9

                Upgrade your compiler to the latest 12.x version as it's an internal compiler error.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                gfxxG 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  Upgrade your compiler to the latest 12.x version as it's an internal compiler error.

                  gfxxG Offline
                  gfxxG Offline
                  gfxx
                  wrote on last edited by
                  #10

                  @Christian-Ehrlicher Thanks a lot .... but with previous step I change compiler from gcc12 to gcc9 or not? Because error is the same if change in previous manner to gcc9 AND if change to default gcc that is gcc12 ....

                  thanks for reply

                  bkt

                  jsulmJ 1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    An internal compiler error is nothing Qt can do against - the only way to fix it is to upgrade to the latest patch version of gcc you're using.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • gfxxG gfxx

                      @Christian-Ehrlicher Thanks a lot .... but with previous step I change compiler from gcc12 to gcc9 or not? Because error is the same if change in previous manner to gcc9 AND if change to default gcc that is gcc12 ....

                      thanks for reply

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      @gfxx said in Qt6.5.3 and QTcreator 9 .... problem to use gcc-9:

                      but with previous step I change compiler from gcc12 to gcc9 or not?

                      You changed from 9 to 12 and wrote that the build fails, right?
                      I asked whether you rebuild from scratch after changing compiler - you did not answer...

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      gfxxG 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @gfxx said in Qt6.5.3 and QTcreator 9 .... problem to use gcc-9:

                        but with previous step I change compiler from gcc12 to gcc9 or not?

                        You changed from 9 to 12 and wrote that the build fails, right?
                        I asked whether you rebuild from scratch after changing compiler - you did not answer...

                        gfxxG Offline
                        gfxxG Offline
                        gfxx
                        wrote on last edited by
                        #13

                        @jsulm no I change from 12 to 9 .... because qtcreator and qt6 support max 9 on linux ..... after these I cancel every build of my project, run again qmake, and after build project. For major safety I close qtcreator, I open it again, I open again project, I check if gcc9 is still the choosen compiler, than clean again project, again qmake, and again build project. .... if you ask me install again qt6 with gcc9 ... these is not done.

                        is ok?

                        bkt

                        1 Reply Last reply
                        0
                        • aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by
                          #14

                          Why do you think max gcc 9 is supported?

                          Qt has to stay free or it will die.

                          1 Reply Last reply
                          1
                          • Axel SpoerlA Offline
                            Axel SpoerlA Offline
                            Axel Spoerl
                            Moderators
                            wrote on last edited by Axel Spoerl
                            #15

                            Well, for openSuSE we officially support max gcc9 (see here). But that's mainly due to backwards compatibility. On openSuSE, Qt compiles with anything from gcc9 till gcc13.

                            Software Engineer
                            The Qt Company, Oslo

                            1 Reply Last reply
                            1
                            • gfxxG Offline
                              gfxxG Offline
                              gfxx
                              wrote on last edited by
                              #16

                              So seems try to downgrade to gcc9 is not necessary .... any how I'm mainly on debian12. So gcc12 is still ok or not?

                              bkt

                              1 Reply Last reply
                              0
                              • aha_1980A Offline
                                aha_1980A Offline
                                aha_1980
                                Lifetime Qt Champion
                                wrote on last edited by
                                #17

                                My experience is, that you can always upgrade gcc and even use that with libraries (like Qt) that are compiled with older gcc versions.

                                The opposite is not always true

                                Regards.

                                Qt has to stay free or it will die.

                                gfxxG 1 Reply Last reply
                                0
                                • aha_1980A aha_1980

                                  My experience is, that you can always upgrade gcc and even use that with libraries (like Qt) that are compiled with older gcc versions.

                                  The opposite is not always true

                                  Regards.

                                  gfxxG Offline
                                  gfxxG Offline
                                  gfxx
                                  wrote on last edited by
                                  #18

                                  @aha_1980 My case is about a qt project create with qt5.15.2 ..... need to upgrade hardware and cpu .... so I use original project not compiled ..... and try to upgrade it to qt6.5 .... because I use debian12, reading qt6 doc, seems need to use gcc9 .... debian12 have as default gcc12 .... so I install gcc9 and use appropriate qtcreator version .... try to compile using gcc9 ... but seems qtcreator non help me on these ..... someone suggest to upgrade my gcc12 because with some bugs, than compile my qt6 project using default gcc12 ..... because qt doc talk about supported gcc version on opensuse and ubuntu (nothing about debian) supported and supported one seems gcc9 .... I try to do these .... but for Axel users these is not necessary .....

                                  I ask for confirmation .... gcc12 work good with qt6.5 in linux system?

                                  bkt

                                  aha_1980A 1 Reply Last reply
                                  0
                                  • gfxxG gfxx

                                    @aha_1980 My case is about a qt project create with qt5.15.2 ..... need to upgrade hardware and cpu .... so I use original project not compiled ..... and try to upgrade it to qt6.5 .... because I use debian12, reading qt6 doc, seems need to use gcc9 .... debian12 have as default gcc12 .... so I install gcc9 and use appropriate qtcreator version .... try to compile using gcc9 ... but seems qtcreator non help me on these ..... someone suggest to upgrade my gcc12 because with some bugs, than compile my qt6 project using default gcc12 ..... because qt doc talk about supported gcc version on opensuse and ubuntu (nothing about debian) supported and supported one seems gcc9 .... I try to do these .... but for Axel users these is not necessary .....

                                    I ask for confirmation .... gcc12 work good with qt6.5 in linux system?

                                    aha_1980A Offline
                                    aha_1980A Offline
                                    aha_1980
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #19

                                    @gfxx Why don't you just try it?

                                    I have several systems with different compilers and as I said, upgrading the compiler mostly unproblematic.

                                    You could, for example try gcc-12 with Qt 5.15.2 first to see if you program compiles. Afterwards, do the upgrade to Qt 6.

                                    Regards

                                    Qt has to stay free or it will die.

                                    1 Reply Last reply
                                    1
                                    • gfxxG Offline
                                      gfxxG Offline
                                      gfxx
                                      wrote on last edited by
                                      #20

                                      thanks a lot .... but qt5.15.2 work with c++20 gcc11 .... not try gcc12 .... but try to install different version of qt6 and where qt6.5.3 lts have almost 6-7 installation problem from online installer ... qt6.6.3 no problem at all during installation process .... previous of these I discover that kernel 6.6 that I previously used have a lot of bug ... some library is impossible to install ... so in any case was inusable for me. So I reinstal SO using these time kernel 6.10 ..... whith no problem about library that previous I have ..... BUT i see a lot of error during qt6.5.3 online installer process .... so I try almost 12 time with plain and totally new installation ... without a complete sucess ... sometime qt6.5.3 istall whitout creator, sometime whitout other module ..... so try one time qt6.6.3 and all work ..... for duble check I try an other plain istall of qt6.6.3 ... same result ... no error at all .... not try until now compile my app just converted on qt6 version .... but for now all work ... and simple browser example work great, where with qt6.5.3 was impossible to use ..... impossible to install correctly webengine in my case with qt6.5.3. ..... these is not my app but use web page on my app for example .... when I try my app on qt creator, I write here the result. But seems most part of problem was solved.

                                      bkt

                                      1 Reply Last reply
                                      0
                                      • gfxxG Offline
                                        gfxxG Offline
                                        gfxx
                                        wrote on last edited by gfxx
                                        #21

                                        exactly ... all previous problem with compile process disappear ... all problem not language decode .... instead of mismatch of compiler now there are only decoding file problem .....

                                        Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                        Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                        

                                        so need to solve these problems (depends from bookworm locale tree) .... Can compile with success I think or with normal error become from wrong code.

                                        bkt

                                        gfxxG 1 Reply Last reply
                                        0
                                        • gfxxG gfxx

                                          exactly ... all previous problem with compile process disappear ... all problem not language decode .... instead of mismatch of compiler now there are only decoding file problem .....

                                          Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                          Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                          

                                          so need to solve these problems (depends from bookworm locale tree) .... Can compile with success I think or with normal error become from wrong code.

                                          gfxxG Offline
                                          gfxxG Offline
                                          gfxx
                                          wrote on last edited by gfxx
                                          #22

                                          @gfxx very interesting ..... I run sudo dpk-reconfigure locales command .... all ok , after these with root permission I read /etc/default/locale and add LC_ALL row .... after I reboot .... that try to build my app on QTCreator 14 (new intallation ...but same error of QTCreator 9) ..... now I have these error .... plus other because some heather was corrupt from QtCreator (original file is perfect, after build these file at end have a lot of bad characters like @#|\ and so on ASCII chars random)....

                                          (repeated more than one time ... almost 20 time ...)
                                          
                                          Detected locale "LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                          Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                          If this causes problems, reconfigure your locale. See the locale(1) manual
                                          for more information.
                                          

                                          But these is my locale commad output ....

                                          @mint51:~$ locale
                                          LANG=it_IT.UTF-8
                                          LANGUAGE=it_IT.UTF-8
                                          LC_CTYPE="it_IT.UTF-8"
                                          LC_NUMERIC="it_IT.UTF-8"
                                          LC_TIME="it_IT.UTF-8"
                                          LC_COLLATE="it_IT.UTF-8"
                                          LC_MONETARY="it_IT.UTF-8"
                                          LC_MESSAGES="it_IT.UTF-8"
                                          LC_PAPER="it_IT.UTF-8"
                                          LC_NAME="it_IT.UTF-8"
                                          LC_ADDRESS="it_IT.UTF-8"
                                          LC_TELEPHONE="it_IT.UTF-8"
                                          LC_MEASUREMENT="it_IT.UTF-8"
                                          LC_IDENTIFICATION="it_IT.UTF-8"
                                          LC_ALL=it_IT.UTF-8
                                          
                                          

                                          So think there are somethings not work on QtCreator and Qt6, But Try again to play aroud locale ....

                                          ******** edit:
                                          my locale is ok ... seems problem is qt6 side. So means previous problem is solved!

                                          regards

                                          bkt

                                          gfxxG 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