Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot change to working directory «...»: file or directory not found



  • Installed Lubuntu 20.04.02, installed Qt Creator 4.14.0 based on Qt 5.15.2. All settings are fine, compilers/assemblers/debuggers are configured. I am creating a project with terminal support. In system settings, x-terminal-emulator is installed with the -e parameter. Lubuntu itself has the qterminal terminal, the only one. I'm trying to put together a trivial project with the ability to enter data - the build is successful:

    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        int a = 0;
        cout << "Enter value: " << endl;
        cin >> a;
        cout << "a = " << a << endl;
        return 0;
    }
    

    I am trying to run a project - I get an error in the application output:

    Cannot change to working directory «/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug»: file or directory not found
    

    1

    2

    3

    As I understand it, the problem is not new and I want to solve it without resorting to installing additional terminal emulators ... I ask for help from the knowledgeable.

    P.S. In other IDE's, everything is compiled and run in an embedded terminal.



  • @alexanderzhirov

    In system settings, x-terminal-emulator is installed with the -e parameter. Lubuntu itself has the qterminal terminal, the only one.

    Confirm how you have set to run qterminal -e? You are saying you have done this, aren't you?

    If you don't get a better answer (and I don't think you will!) I would:

    • Verify you can run qterminal as a command, and verify you can run qterminal -e ls or similar.

    • Temporarily replace qterminal -e from being the terminal command with something which prints exactly whatever it receives on the command line to a log file so we can see just what the full command line Creator is generating reads. I don't know why a problem at the executable level would cause "your directory not found", but let's see if it gets as far as your log.



  • @JonB said in Cannot change to working directory «...»: file or directory not found:

    Confirm how you have set to run qterminal -e? You are saying you have done this, aren't you?

    Yes, I set qterminal directly.

    @JonB said in Cannot change to working directory «...»: file or directory not found:

    Verify you can run qterminal as a command, and verify you can run qterminal -e ls or similar.

    user@vb:~$ qterminal -e ls
    Properties constructor called
    TRANSLATIONS_DIR: Loading translation file "qterminal_ru_RU.qm" from dir /usr/share/qterminal/translations
    load success: true
    Icon theme "elementary" not found.
    QDir::exists: Empty or null file name
    QDir::exists: Empty or null file name
    Canot open file "/home/user/.config/qterminal.org/qterminal_bookmarks.xml"
    Trying to load translation file from dir "/usr/share/Lubuntu"
    Trying to load translation file from dir "/usr/local/share"
    Trying to load translation file from dir "/usr/share"
    Trying to load translation file from dir "/var/lib/snapd/desktop"
    Trying to load translation file from dir "/usr/share/qtermwidget5/translations"
    default KB_LAYOUT_DIR:  "/usr/share/qtermwidget5/kb-layouts"
    loadAllColorSchemes
    Shell program: "ls"
    ("ls")
    Properties destructor called
    user@vb:~$ qterminal -e /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test 
    Properties constructor called
    TRANSLATIONS_DIR: Loading translation file "qterminal_ru_RU.qm" from dir /usr/share/qterminal/translations
    load success: true
    Icon theme "elementary" not found.
    QDir::exists: Empty or null file name
    QDir::exists: Empty or null file name
    Canot open file "/home/user/.config/qterminal.org/qterminal_bookmarks.xml"
    Trying to load translation file from dir "/usr/share/Lubuntu"
    Trying to load translation file from dir "/usr/local/share"
    Trying to load translation file from dir "/usr/share"
    Trying to load translation file from dir "/var/lib/snapd/desktop"
    Trying to load translation file from dir "/usr/share/qtermwidget5/translations"
    default KB_LAYOUT_DIR:  "/usr/share/qtermwidget5/kb-layouts"
    loadAllColorSchemes
    Shell program: "/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test"
    ("/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test")
    

    My program requested data entry and executed successfully.

    Properties destructor called
    user@vb:~$
    

    @JonB said in Cannot change to working directory «...»: file or directory not found:

    Temporarily replace qterminal -e from being the terminal command with something which prints exactly whatever it receives on the command line to a log file so we can see just what the full command line Creator is generating reads. I don't know why a problem at the executable level would cause "your directory not found", but let's see if it gets as far as your log.

    I don't quite understand what you mean. But I can launch Qt Creator through the terminal and get the output of messages to the terminal when I run my program:

    user@vb:~$ qtcreator
    Properties constructor called
    TRANSLATIONS_DIR: Loading translation file "qterminal_ru_RU.qm" from dir /usr/share/qterminal/translations
    load success: true
    Icon theme "elementary" not found.
    QDir::exists: Empty or null file name
    QDir::exists: Empty or null file name
    Canot open file "/home/user/.config/qterminal.org/qterminal_bookmarks.xml"
    Trying to load translation file from dir "/usr/share/Lubuntu"
    Trying to load translation file from dir "/usr/local/share"
    Trying to load translation file from dir "/usr/share"
    Trying to load translation file from dir "/var/lib/snapd/desktop"
    Trying to load translation file from dir "/usr/share/qtermwidget5/translations"
    default KB_LAYOUT_DIR:  "/usr/share/qtermwidget5/kb-layouts"
    loadAllColorSchemes
    Shell program: "/opt/Qt/Tools/QtCreator/bin/../libexec/qtcreator/qtcreator_process_stub run /tmp/QtCreator.ZPtjNF/stub-socket Для закрытия данного окна нажмите <ВВОД>... /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug /tmp/QtCreator.kcxFmh 1130 /home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test"
    ("/opt/Qt/Tools/QtCreator/bin/../libexec/qtcreator/qtcreator_process_stub", "run", "/tmp/QtCreator.ZPtjNF/stub-socket", "Для", "закрытия", "данного", "окна", "нажмите", "<ВВОД>...", "/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug", "/tmp/QtCreator.kcxFmh", "1130", "/home/user/Programming/build-test-Desktop_Qt_5_15_2_GCC_64bit-Debug/test")
    Invalid run control state transition from  "RunControlState::Starting"  to  "RunControlState::Stopped"
    Properties destructor called
    


  • @alexanderzhirov
    Yeah, the console output you have just pasted is doubtless the issue. It may have nothing to do with qterminal vs xterm, or anything else. I don't know why though. Ensure you can create that path, though I'm sure you can.

    Which then takes you all the way back to xterm after all via https://stackoverflow.com/questions/14010521/cannot-connect-creator-comm-socket-tmp-qt-temp-jh2103-stub-socket-no-such-file

    I think you're on your own figuring why qterminal is problematic....

    P.S.
    https://bugreports.qt.io/browse/QTCREATORBUG-6007 from 2011.

    Everybody ends up using /usr/bin/xterm -e :)



  • @JonB said in Cannot change to working directory «...»: file or directory not found:

    Everybody ends up using /usr/bin/xterm -e :)

    Yes, i know it:)

    1

    But need to understand why this does not work with QTerminal. On github, they believe that it has nothing to do with it.

    The question is still open.



  • Created a bug report.


Log in to reply