Failed to start program. Path or permissions wrong? in Qt

陌路散爱 提交于 2019-12-01 03:20:23
mmoment

I think the problem you are facing here are either the user rights of the executable or a wrong build path.

First, try setting the build path under 'Projects' - 'General' - Build Directory to a correct path.

If that doesn't work, open the terminal, go to the build path and execute ./QtBuildProgram

If that doesn't work, take a look at the user rights ls -a ./QtBuildProgram

Maybe the executable rights are not granted because you are running the Creator in another user mode as the terminal emulator.

Just to be sure, execute sudo chmod u+x QtBuildProgram and then execute the program from the command line by typing ./QtBuildProgram

That should also allow you to run the program from the QtCreator again.

I had the same issue in Windows. I found the answer. You need to check the "Working directory" parameter in "Run Settings" section. I changed it to the same path as my build directory and it worked.

I was running QT as admin.

Luke Murray

My mac didn't have valgrind installed by default so I had to

brew install valgrind

Go back to QT Creator, and in Projects -> Run -> Valgrind Settings

Point the Valgrind executable to the brew installed version which you can find by typing which valgrind on the command line.

Finally due to the bug report here I realized that valgrind 3.13 has a bug and doesn't work, and valgrind 3.12 also doesn't work on macs, and mac os high sierra isn't supported by valgrind. So you're basically out of look until 3.14 comes around.

In my case, it was because I have a 32-bit CPU and it was building 64-bit executables. I only figured this out after trying to run it from the command line though.

Check your run settings and see if the exe path is existing and file is built there. If you are running windows 7 or windows 8, set the qtcreator executable's settings to "Run as administrator".

Check your antivirus settings.

That was my issue.

In my case this error was caused by a space at the start of "Working directory" path in "Run Settings".

Andrea Romero

In my case it was because I was missing these two lines of code at the top of the project. Make sure you have them without any space above :

#! /usr/bin/env python
# -*- coding: utf-8 -*-
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!