Important: Please read the Qt Code of Conduct -

QtCreator hangs in debug mode on shell command execution

  • Hi!
    I have met a problem with debug mode in QtCreator 2.7.1 based on QT 5.0.2 (64 bit). Linux, Ubuntu.
    Here is a simple code to reproduce:

    @#include <iostream>
    #include <stdlib.h>

    using namespace std;

    int main(int argc, char** argv)
    cout << "Before system call..." << endl;

    system&#40;"pwd"&#41;; // Hangs here in debug mode!!!
    cout << "After system call..." << endl;


    In Run mode, works fine, output is:
    Before system call...
    After system call...

    In Debug mode, hangs on system("pwd"), output is:
    Before system call...

    Project settings:
    TEMPLATE = app
    TARGET = main
    QT -= core gui

    SOURCES += ../main.cpp

    Please, help to investigate and configure project or environment properly.

Log in to reply