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
Qt 6.11 is out! See what's new in the release blog

Error writing to invalid argument

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 3.2k 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.
  • J Jyothi

    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

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on 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 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
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 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 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

          JonBJ 1 Reply Last reply
          0
          • J Jyothi

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

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

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on 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
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 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
              • JonBJ JonB

                @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 last edited by
                #8

                @JonB

                yes sir,

                tried those but no use

                JonBJ 1 Reply Last reply
                0
                • J Jyothi

                  @JonB

                  yes sir,

                  tried those but no use

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on 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 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

                    JonBJ 1 Reply Last reply
                    0
                    • J Jyothi

                      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

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on 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

                      • Login

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