Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt executable does not exist in Cmake project

I have a cmake project opened in Qt5.2.1 under Ubuntu 14.04. In project->build->CMake arguments: -DCMAKE_BUILD_TYPE:=Debug

After I build successfully the project and try to run it, I get the following error in the Application Output: Executable /home/../foo does not exist. If I try to debug the application, a popup window error is:

Starting executable failed: /home/../foo: No such file or directory.

The executable is built but the name is actually food and not foo. So, it is obvious why the run and debug can't find the executable. I'm new with Qt. What am I missing here?

like image 691
Elod Avatar asked Jun 10 '26 20:06

Elod


2 Answers

Go to Project->Run and from "Run configuration" button group select "Add" combo box. Then select "Custom Executable".

Then Browse and select path to executable.

I'm using Qt 5.9.

like image 173
Hareen Laks Avatar answered Jun 14 '26 15:06

Hareen Laks


I found two solutions:

  1. in Project->Run Add new executable. If foo was the first, then for debug add a new executable, it will be called foo2 and this will be pointing to the good executable food.

  2. install Qt5.7 with Qt-creator 4.0.2 - everything works out of the box

I prefer the second.

like image 44
Elod Avatar answered Jun 14 '26 16:06

Elod