Qt running error "Executable does not exist"

Viewed 2019

I installed Qt version 5 on Mac OSX and tried to build a simple project found on a book.

The project at first compiled and run correctly then I tried to do Clean all and Build all. At this point it seems to compile correctly, but when I try to run it, I am getting the following error:

Executable /Users/myMac/build-project_name-Desktop_Qt_5_5_1_clang_64bit-Debug/project_name.app/Contents/MacOS/project_name does not exist

Notice that the project folder is /Users/myMac/project_name

I had also to modify the file *.pro by adding QT += widgets because I got also the TARGET is empty error.

I tried to look for older questions but I did not find anything useful. Does anyone have any suggestion?

Here is my .pro file:

######################################################################
# Automatically generated by qmake (2.01a) Sun Mar 20 21:45:06 2016
######################################################################
QT += widgets
TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .

# Input
HEADERS += finddialog.h mainwindow.h
FORMS += mainwindow.ui
SOURCES += finddialog.cpp main.cpp mainwindow.cpp`
1 Answers

I needed to exit and restart QtCreator to fix a similar issue, although my error is slightly different from the OP's.

I am using CMakeLists.txt projects in QtCreator and we have a complicated cross-platform set of hundreds of projects.

Here is what led to my problem and I just reproduced it in Qt Creator 4.4.0 to verify the steps:

  1. I added a new, command-line utility project in a subdirectory (i.e. add_subdirectory in CMake) by copying another similar project - I forgot to change the name
  2. I ran CMake and it failed because the name was defined previously
  3. I corrected the name of the new project (to 'a_exp')
  4. I reran CMake successfully and QtCreator located the new project, a_exp
  5. I used QtCreator to build the executable, a_exp
  6. I confirmed in the shell that I could run the executable, a_exp
  7. When I attempted to run in QtCreator, I got an error like the OP

Here is the error:

Starting a_exp...
Executable a_exp does not exist.
Related