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. [Solved]No such file or directory error

[Solved]No such file or directory error

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 7.0k 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.
  • G Offline
    G Offline
    graham1941
    wrote on 3 Dec 2013, 16:03 last edited by
    #1

    Sirs
    I have recently upgraded my OS from Ubuntu 10.04 to Mint 15 and attempting to recompile my existing code.
    I have a program that compiled before and now fails with a No such file or directory error.
    My pro file looks like this:
    @
    TARGET = inputDialogue
    TEMPLATE = lib
    QT += widgets
    DEFINES += INPUTDIALOGUE_LIBRARY

    SOURCES += inputdialogue.cpp

    HEADERS += inputdialogue.h
    inputDialogue_global.h
    @

    inputdialog.h looks like this:
    @
    #ifndef INPUTDIALOGUE_H
    #define INPUTDIALOGUE_H

    #include "inputDialogue_global.h"
    #include <QApplication>
    #include <QtWidgets>
    #include </usr/include/qt4/QtGui/QtGui>
    #include </usr/include/qt4/QtGui/QMessageBox>
    #include </usr/include/qt4/QtGui/QInputDialog>
    //
    enum SEVERITY { QUESTION, INFORMATION, WARNING, CRITICAL};

    class INPUTDIALOGUESHARED_EXPORT InputDialogue {
    public:
    InputDialogue();

    QString getError(void) { return errorMsg; }
    void setError(QString txt) { errorMsg = txt; }

    QString getLabelText(void) { return Label; }
    void setLabelText(QString txt) { Label = txt; }

    int getResponse(void) { return response; }
    void setResponse(int res) { response = res; }

    void test(int);

    private:
    QString Label;
    QString errorMsg;
    int response;
    };

    #endif // INPUTDIALOGUE_H
    @

    inputDialogue_global.h like this:

    @
    #ifndef INPUTDIALOGUE_GLOBAL_H
    #define INPUTDIALOGUE_GLOBAL_H

    #include <QtCore/qglobal.h>

    #if defined(INPUTDIALOGUE_LIBRARY)

    define INPUTDIALOGUESHARED_EXPORT Q_DECL_EXPORT

    #else

    define INPUTDIALOGUESHARED_EXPORT Q_DECL_IMPORT

    #endif

    #endif // INPUTDIALOGUE_GLOBAL_

    @

    inputdialogue.cpp like this:

    @
    #include "inputdialogue.h"

    InputDialogue::InputDialogue()
    {
    }

    //InputDialogue INPUTDIALOGUESHARED_EXPORT inputdialog;

    void InputDialogue::test(int mode)
    {
    QString title;
    QMessageBox msgBox;
    int ret;

    title = getLabelText();
    errorMsg = getError();

    setResponse(NULL);
    msgBox.setText(title);
    msgBox.setInformativeText(errorMsg);
    switch (mode)
    {
    //case information:
    case INFORMATION:
    msgBox.setIcon(QMessageBox::Information);
    msgBox.setStandardButtons(QMessageBox::Ok );
    msgBox.setDefaultButton(QMessageBox::Ok);
    ret = msgBox.exec();
    setResponse(0);
    break;

    //case warning:
    case WARNING:
    msgBox.setIcon(QMessageBox::Warning);
    msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
    msgBox.setDefaultButton(QMessageBox::Ok);
    switch (msgBox.exec())
    {
    case QMessageBox::Ok:
    setResponse(0);
    break;
    case QMessageBox::Cancel:
    setResponse(2);
    break;
    }
    break;

    //case critical:
    case CRITICAL:
    msgBox.setIcon(QMessageBox::Critical);
    msgBox.setStandardButtons(QMessageBox::Ok );
    msgBox.setDefaultButton(QMessageBox::Ok);
    ret = msgBox.exec();
    setResponse(0);
    break;

    //case question:
    case QUESTION:
    msgBox.setIcon(QMessageBox::Question);
    msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
    msgBox.setDefaultButton(QMessageBox::Ok);
    switch (msgBox.exec())
    {
    case QMessageBox::Ok:
    setResponse(0);
    break;
    case QMessageBox::No:
    setResponse(1);
    break;
    case QMessageBox::Cancel:
    setResponse(2);
    break;
    }
    break;
    }
    }
    @
    Any information would be greatfully received.
    Thank you in anticipation.
    Graham B

    MijazM 1 Reply Last reply 20 Apr 2020, 10:01
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Dec 2013, 21:01 last edited by
      #2

      Hi and welcome to devnet,

      You have to give more information about your error. "No such file or directory" alone doesn't really help, what can't it find ? Which version of Qt are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        graham1941
        wrote on 3 Dec 2013, 22:55 last edited by
        #3

        Hi SGaist
        Thank you for your response.
        On compiling I get the following error message:
        @
        /usr/include/qt4/QtGui/qinputcontext.h:64: error: QtGui/qaction.h: No such file or directory
        @
        Both these header files do exist in the includes directory.
        I am using Qt4.
        I note from other answers to this question that QT += widget should be included in the pro file, which I have done.
        I originally created this program in February on ubuntu 10.04 without a problem.
        Is there something I'm missing here?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 3 Dec 2013, 23:02 last edited by
          #4

          It should be included for Qt 5 project and should give you an error currently if you are using Qt 4.

          So are you sure you are using the correct qmake ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            graham1941
            wrote on 4 Dec 2013, 10:01 last edited by
            #5

            It would appear that I am using qt5.
            I have decided to start from scratch with an empty project and copy/paste chunks of code and recompile. Probably the easest way.
            Thank you for all your help.
            Graham B

            SGaistS 1 Reply Last reply 20 Apr 2020, 18:11
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 4 Dec 2013, 11:54 last edited by
              #6

              You're welcome,

              If you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • G graham1941
                3 Dec 2013, 16:03

                Sirs
                I have recently upgraded my OS from Ubuntu 10.04 to Mint 15 and attempting to recompile my existing code.
                I have a program that compiled before and now fails with a No such file or directory error.
                My pro file looks like this:
                @
                TARGET = inputDialogue
                TEMPLATE = lib
                QT += widgets
                DEFINES += INPUTDIALOGUE_LIBRARY

                SOURCES += inputdialogue.cpp

                HEADERS += inputdialogue.h
                inputDialogue_global.h
                @

                inputdialog.h looks like this:
                @
                #ifndef INPUTDIALOGUE_H
                #define INPUTDIALOGUE_H

                #include "inputDialogue_global.h"
                #include <QApplication>
                #include <QtWidgets>
                #include </usr/include/qt4/QtGui/QtGui>
                #include </usr/include/qt4/QtGui/QMessageBox>
                #include </usr/include/qt4/QtGui/QInputDialog>
                //
                enum SEVERITY { QUESTION, INFORMATION, WARNING, CRITICAL};

                class INPUTDIALOGUESHARED_EXPORT InputDialogue {
                public:
                InputDialogue();

                QString getError(void) { return errorMsg; }
                void setError(QString txt) { errorMsg = txt; }

                QString getLabelText(void) { return Label; }
                void setLabelText(QString txt) { Label = txt; }

                int getResponse(void) { return response; }
                void setResponse(int res) { response = res; }

                void test(int);

                private:
                QString Label;
                QString errorMsg;
                int response;
                };

                #endif // INPUTDIALOGUE_H
                @

                inputDialogue_global.h like this:

                @
                #ifndef INPUTDIALOGUE_GLOBAL_H
                #define INPUTDIALOGUE_GLOBAL_H

                #include <QtCore/qglobal.h>

                #if defined(INPUTDIALOGUE_LIBRARY)

                define INPUTDIALOGUESHARED_EXPORT Q_DECL_EXPORT

                #else

                define INPUTDIALOGUESHARED_EXPORT Q_DECL_IMPORT

                #endif

                #endif // INPUTDIALOGUE_GLOBAL_

                @

                inputdialogue.cpp like this:

                @
                #include "inputdialogue.h"

                InputDialogue::InputDialogue()
                {
                }

                //InputDialogue INPUTDIALOGUESHARED_EXPORT inputdialog;

                void InputDialogue::test(int mode)
                {
                QString title;
                QMessageBox msgBox;
                int ret;

                title = getLabelText();
                errorMsg = getError();

                setResponse(NULL);
                msgBox.setText(title);
                msgBox.setInformativeText(errorMsg);
                switch (mode)
                {
                //case information:
                case INFORMATION:
                msgBox.setIcon(QMessageBox::Information);
                msgBox.setStandardButtons(QMessageBox::Ok );
                msgBox.setDefaultButton(QMessageBox::Ok);
                ret = msgBox.exec();
                setResponse(0);
                break;

                //case warning:
                case WARNING:
                msgBox.setIcon(QMessageBox::Warning);
                msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
                msgBox.setDefaultButton(QMessageBox::Ok);
                switch (msgBox.exec())
                {
                case QMessageBox::Ok:
                setResponse(0);
                break;
                case QMessageBox::Cancel:
                setResponse(2);
                break;
                }
                break;

                //case critical:
                case CRITICAL:
                msgBox.setIcon(QMessageBox::Critical);
                msgBox.setStandardButtons(QMessageBox::Ok );
                msgBox.setDefaultButton(QMessageBox::Ok);
                ret = msgBox.exec();
                setResponse(0);
                break;

                //case question:
                case QUESTION:
                msgBox.setIcon(QMessageBox::Question);
                msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
                msgBox.setDefaultButton(QMessageBox::Ok);
                switch (msgBox.exec())
                {
                case QMessageBox::Ok:
                setResponse(0);
                break;
                case QMessageBox::No:
                setResponse(1);
                break;
                case QMessageBox::Cancel:
                setResponse(2);
                break;
                }
                break;
                }
                }
                @
                Any information would be greatfully received.
                Thank you in anticipation.
                Graham B

                MijazM Offline
                MijazM Offline
                Mijaz
                wrote on 20 Apr 2020, 10:01 last edited by
                #7

                @graham1941
                I also facing same error. I am using version qt5 . How you fixed this error?

                1 Reply Last reply
                0
                • G graham1941
                  4 Dec 2013, 10:01

                  It would appear that I am using qt5.
                  I have decided to start from scratch with an empty project and copy/paste chunks of code and recompile. Probably the easest way.
                  Thank you for all your help.
                  Graham B

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 20 Apr 2020, 18:11 last edited by
                  #8

                  @Mijaz it's written right here:
                  @graham1941 said in [Solved]No such file or directory error:

                  It would appear that I am using qt5.
                  I have decided to start from scratch with an empty project and copy/paste chunks of code and recompile. Probably the easest way.
                  Thank you for all your help.
                  Graham B

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • T tugbakara referenced this topic on 10 Sept 2024, 14:41

                  • Login

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