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. I cannot run a program with MinGW 32bit but only with 64bit
Qt 6.11 is out! See what's new in the release blog

I cannot run a program with MinGW 32bit but only with 64bit

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 643 Views
  • 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.
  • E Offline
    E Offline
    Edoardo_P
    wrote on last edited by Edoardo_P
    #1

    Hi to everyone!
    It's a lot of days that i've this problem and i'm not able to figure out!
    First of all i want to say that i've uninstall all QT program from my computer and after that i've install with the online installer the Qt 5.14.2 with MinGW 32bit and MinGW 64bit (version of the compiler 7.3.0) compilers. After the installation, i created a new empty project (mainwindow.h, mainwindow.cpp, mainwindow.ui, main.cpp). If i run this program with a MinGW 64bit all works fine, instead if i use the MinGW 32bit it's crash without errors. I also tried to install different version of MinGW for 32bit (version of the compiler 5.3.0), but also in this case it crash without any errors.

    Someone can help me?

    I can also post all the informations

    .pro:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

    mainwindow.h:

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    
    QT_BEGIN_NAMESPACE
    namespace Ui { class MainWindow; }
    QT_END_NAMESPACE
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
    };
    #endif // MAINWINDOW_H
    
    

    mainwindow.cpp:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    
    

    main.cpp:

    #include "mainwindow.h"
    
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
        return a.exec();
    }
    
    

    This is the compile output for the 32bit compiler:
    alt text
    This is the compile output for the 64bit compiler:
    alt text

    This is the application output for the 32bit compiler:
    alt text
    This is the application output for the 64bit compiler:
    alt text

    Christian EhrlicherC J.HilkJ 2 Replies Last reply
    0
    • E Edoardo_P

      Hi to everyone!
      It's a lot of days that i've this problem and i'm not able to figure out!
      First of all i want to say that i've uninstall all QT program from my computer and after that i've install with the online installer the Qt 5.14.2 with MinGW 32bit and MinGW 64bit (version of the compiler 7.3.0) compilers. After the installation, i created a new empty project (mainwindow.h, mainwindow.cpp, mainwindow.ui, main.cpp). If i run this program with a MinGW 64bit all works fine, instead if i use the MinGW 32bit it's crash without errors. I also tried to install different version of MinGW for 32bit (version of the compiler 5.3.0), but also in this case it crash without any errors.

      Someone can help me?

      I can also post all the informations

      .pro:

      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++11
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
          main.cpp \
          mainwindow.cpp
      
      HEADERS += \
          mainwindow.h
      
      FORMS += \
          mainwindow.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      

      mainwindow.h:

      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      
      QT_BEGIN_NAMESPACE
      namespace Ui { class MainWindow; }
      QT_END_NAMESPACE
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          MainWindow(QWidget *parent = nullptr);
          ~MainWindow();
      
      private:
          Ui::MainWindow *ui;
      };
      #endif // MAINWINDOW_H
      
      

      mainwindow.cpp:

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      
      

      main.cpp:

      #include "mainwindow.h"
      
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          return a.exec();
      }
      
      

      This is the compile output for the 32bit compiler:
      alt text
      This is the compile output for the 64bit compiler:
      alt text

      This is the application output for the 32bit compiler:
      alt text
      This is the application output for the 64bit compiler:
      alt text

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Edoardo_P

      I cannot compile with MinGW 32bit but only with 64bit

      You topic is wrong - the compilation succeeded but you can not run it. Run it in debug mode to see what's going wrong.

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

      E 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @Edoardo_P

        I cannot compile with MinGW 32bit but only with 64bit

        You topic is wrong - the compilation succeeded but you can not run it. Run it in debug mode to see what's going wrong.

        E Offline
        E Offline
        Edoardo_P
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        I change the topic, thank you!
        In debug mode:
        alt text

        1 Reply Last reply
        0
        • E Edoardo_P

          Hi to everyone!
          It's a lot of days that i've this problem and i'm not able to figure out!
          First of all i want to say that i've uninstall all QT program from my computer and after that i've install with the online installer the Qt 5.14.2 with MinGW 32bit and MinGW 64bit (version of the compiler 7.3.0) compilers. After the installation, i created a new empty project (mainwindow.h, mainwindow.cpp, mainwindow.ui, main.cpp). If i run this program with a MinGW 64bit all works fine, instead if i use the MinGW 32bit it's crash without errors. I also tried to install different version of MinGW for 32bit (version of the compiler 5.3.0), but also in this case it crash without any errors.

          Someone can help me?

          I can also post all the informations

          .pro:

          QT       += core gui
          
          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
          
          CONFIG += c++11
          
          # You can make your code fail to compile if it uses deprecated APIs.
          # In order to do so, uncomment the following line.
          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
          
          SOURCES += \
              main.cpp \
              mainwindow.cpp
          
          HEADERS += \
              mainwindow.h
          
          FORMS += \
              mainwindow.ui
          
          # Default rules for deployment.
          qnx: target.path = /tmp/$${TARGET}/bin
          else: unix:!android: target.path = /opt/$${TARGET}/bin
          !isEmpty(target.path): INSTALLS += target
          

          mainwindow.h:

          #ifndef MAINWINDOW_H
          #define MAINWINDOW_H
          
          #include <QMainWindow>
          
          QT_BEGIN_NAMESPACE
          namespace Ui { class MainWindow; }
          QT_END_NAMESPACE
          
          class MainWindow : public QMainWindow
          {
              Q_OBJECT
          
          public:
              MainWindow(QWidget *parent = nullptr);
              ~MainWindow();
          
          private:
              Ui::MainWindow *ui;
          };
          #endif // MAINWINDOW_H
          
          

          mainwindow.cpp:

          #include "mainwindow.h"
          #include "ui_mainwindow.h"
          
          MainWindow::MainWindow(QWidget *parent)
              : QMainWindow(parent)
              , ui(new Ui::MainWindow)
          {
              ui->setupUi(this);
          }
          
          MainWindow::~MainWindow()
          {
              delete ui;
          }
          
          
          

          main.cpp:

          #include "mainwindow.h"
          
          #include <QApplication>
          
          int main(int argc, char *argv[])
          {
              QApplication a(argc, argv);
              MainWindow w;
              w.show();
              return a.exec();
          }
          
          

          This is the compile output for the 32bit compiler:
          alt text
          This is the compile output for the 64bit compiler:
          alt text

          This is the application output for the 32bit compiler:
          alt text
          This is the application output for the 64bit compiler:
          alt text

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Edoardo_P did you turn off shadow build in the project settings? Could be a reason


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          E 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Edoardo_P did you turn off shadow build in the project settings? Could be a reason

            E Offline
            E Offline
            Edoardo_P
            wrote on last edited by
            #5

            @J-Hilk
            No i didn't. The Shadow build is checked!
            @Christian-Ehrlicher

            The figure that i posted before, is in the debug mode with MinGW 5.3 32bit if i run in debug mode with MinGW 7.3 32bit the figure not appear and in the application output i can see this:

            alt text

            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