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. Error writing to invalid argument
QtWS25 Last Chance

Error writing to invalid argument

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 1.4k 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.
  • J Offline
    J Offline
    Jyothi
    wrote on 27 May 2021, 04:05 last edited by
    #1

    Hii iam getting the following error while building the just sample project. i found solutions like
    i) shadow build
    ii)create debug and release foler
    iii) remove \ after the lat cpp or .h file in .pro

    tried all those but no result.
    is there any solution for this? please help me

    6115c69f-b83b-4704-abde-04007ecc0bce-image.png

    J 1 Reply Last reply 27 May 2021, 05:09
    0
    • J Jyothi
      27 May 2021, 04:05

      Hii iam getting the following error while building the just sample project. i found solutions like
      i) shadow build
      ii)create debug and release foler
      iii) remove \ after the lat cpp or .h file in .pro

      tried all those but no result.
      is there any solution for this? please help me

      6115c69f-b83b-4704-abde-04007ecc0bce-image.png

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 27 May 2021, 05:09 last edited by jsulm
      #2

      @Jyothi Do you really get this when you build the projects? If so then please post the whole compiler output including the very first warning/error.
      Also, what Qt version and compiler do you use?

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

      1 Reply Last reply
      2
      • J Offline
        J Offline
        Jyothi
        wrote on 28 May 2021, 03:27 last edited by
        #3

        Hi,
        yes usually i will get this error. But every time i will uninstall and install the QT again. But this is not always the correct solution. i just need a permanent solution for this. Please help me to solve this.

        compiler output:

        9f5b6d78-2817-45a4-b35d-2c77af1a692c-image.png

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 28 May 2021, 05:16 last edited by
          #4

          Fix your main.cpp - the compiler tells you where you made an error so fix it.

          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
          • J Offline
            J Offline
            Jyothi
            wrote on 28 May 2021, 09:56 last edited by
            #5

            hi, nothing written in man.cpp. its just a sample qt deafult cpp file only

            aac55730-d78f-4c31-a87d-d1433851fa40-image.png

            J 1 Reply Last reply 28 May 2021, 10:23
            0
            • J Jyothi
              28 May 2021, 09:56

              hi, nothing written in man.cpp. its just a sample qt deafult cpp file only

              aac55730-d78f-4c31-a87d-d1433851fa40-image.png

              J Offline
              J Offline
              JonB
              wrote on 28 May 2021, 10:23 last edited by
              #6

              @Jyothi
              Have a read of https://stackoverflow.com/questions/42873311/error-writing-to-invalid-argument to see if anything there is your situation.

              J 1 Reply Last reply 1 Jun 2021, 09:47
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 28 May 2021, 10:34 last edited by Christian Ehrlicher
                #7

                Then the error is in mainwindow.h and the compiler can only give a follow-up error because you miss a ) in there.

                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
                2
                • J JonB
                  28 May 2021, 10:23

                  @Jyothi
                  Have a read of https://stackoverflow.com/questions/42873311/error-writing-to-invalid-argument to see if anything there is your situation.

                  J Offline
                  J Offline
                  Jyothi
                  wrote on 1 Jun 2021, 09:47 last edited by
                  #8

                  @JonB

                  yes sir,

                  tried those but no use

                  J 1 Reply Last reply 1 Jun 2021, 10:51
                  0
                  • J Jyothi
                    1 Jun 2021, 09:47

                    @JonB

                    yes sir,

                    tried those but no use

                    J Offline
                    J Offline
                    JonB
                    wrote on 1 Jun 2021, 10:51 last edited by
                    #9

                    @Jyothi
                    Then you should look at your mainwindow.h as suggested by @Christian-Ehrlicher. If you choose to post it here, please paste the text from the file, not a screenshot.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      Jyothi
                      wrote on 2 Jun 2021, 03:08 last edited by
                      #10

                      Hi,

                      this is my mainwindow.h file

                      #ifndef MAINWINDOW_H
                      #define MAINWINDOW_H

                      #include <QMainWindow>

                      namespace Ui {
                      class MainWindow;
                      }

                      class MainWindow : public QMainWindow
                      {
                      Q_OBJECT

                      public:
                      explicit MainWindow(QWidget *parent = 0);
                      ~MainWindow();

                      private:
                      Ui::MainWindow *ui;
                      };

                      #endif // MAINWINDOW_H

                      J 1 Reply Last reply 2 Jun 2021, 07:36
                      0
                      • J Jyothi
                        2 Jun 2021, 03:08

                        Hi,

                        this is my mainwindow.h file

                        #ifndef MAINWINDOW_H
                        #define MAINWINDOW_H

                        #include <QMainWindow>

                        namespace Ui {
                        class MainWindow;
                        }

                        class MainWindow : public QMainWindow
                        {
                        Q_OBJECT

                        public:
                        explicit MainWindow(QWidget *parent = 0);
                        ~MainWindow();

                        private:
                        Ui::MainWindow *ui;
                        };

                        #endif // MAINWINDOW_H

                        J Offline
                        J Offline
                        JonB
                        wrote on 2 Jun 2021, 07:36 last edited by
                        #11

                        @Jyothi
                        I cannot see anything wrong there.

                        I really expected something from that stackoverflow post I referred you to to be at issue, but you say not. You might want to paste your .pro file because of one of the tips there?

                        Otherwise I can only suggest you start a fresh project in a fresh directory. Do not even define your own MainWindow. Start with just a QWidget or a QMainWindow. In fact, you could change your existing program to use a QMainWindow instead of MainWindow, and #include <QMainWindow> in place of #include "mainwindow.h". Does that work? Then build back up to what you have now.

                        1 Reply Last reply
                        0

                        3/11

                        28 May 2021, 03:27

                        topic:navigator.unread, 8
                        • Login

                        • Login or register to search.
                        3 out of 11
                        • First post
                          3/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved