无法启动程序。路径或权限错误?在 Qt 中

发布于 2024-09-27 22:15:27 字数 791 浏览 9 评论 0原文

我已经下载了 Qt Mobility 开源项目。我有一组演示应用程序。当构建它并启动应用程序时,我收到此错误:

启动程序失败。路径或 权限错误?

有人能告诉我这个问题可能是什么吗?

更新:

完整的错误是:

开始 /Users/xxxxx/Qt/qt-mobility-opensource-src-1.0.2/config.app/Contents/MacOS/config... 无法启动程序。路径或 权限错误?

我已包含“.pro”文件内容:

TEMPLATE = app
TARGET = writemessage

QT += gui

include(../examples.pri)

CONFIG += mobility
MOBILITY = messaging
INCLUDEPATH += ../../src/messaging

HEADERS += \
    messagesender.h

SOURCES += \
    messagesender.cpp\
    main.cpp

symbian:TARGET.CAPABILITY = NetworkServices \
    LocalServices \
    ReadUserData \
    WriteUserData \
    UserEnvironment \
    ReadDeviceData \
    WriteDeviceData

I have downloaded Qt Mobility Open source project. I had a set of demo apps. And when built it and started the App, I got this error:

Failed to start program. Path or
permissions wrong?

Can someone tell me what this problem could be?

UPDATE:

The complete error is:

Starting
/Users/xxxxx/Qt/qt-mobility-opensource-src-1.0.2/config.app/Contents/MacOS/config...
Failed to start program. Path or
permissions wrong?

I have include the ".pro" file contents:

TEMPLATE = app
TARGET = writemessage

QT += gui

include(../examples.pri)

CONFIG += mobility
MOBILITY = messaging
INCLUDEPATH += ../../src/messaging

HEADERS += \
    messagesender.h

SOURCES += \
    messagesender.cpp\
    main.cpp

symbian:TARGET.CAPABILITY = NetworkServices \
    LocalServices \
    ReadUserData \
    WriteUserData \
    UserEnvironment \
    ReadDeviceData \
    WriteDeviceData

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

柠檬 2024-10-04 22:15:27

我在 Windows 中也遇到了同样的问题。我找到了答案。您需要检查“运行设置”部分中的“工作目录”参数。
我将其更改为与构建目录相同的路径并且它有效。

我以管理员身份运行 QT。

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.

独享拥抱 2024-10-04 22:15:27

我的 mac 默认情况下没有安装 valgrind,所以我必须

brew install valgrind

返回 QT Creator,然后在“项目”->“运行-> Valgrind 设置

将 Valgrind 可执行文件指向您可以安装的brew版本
通过在命令行中输入 which valgrind 进行查找。

最后,由于此处的错误报告,我意识到 valgrind 3.13 有一个错误,并且没有不起作用,valgrind 3.12 也不适用于 Mac,并且 valgrind 不支持 mac os high Sierra。所以在 3.14 到来之前你基本上都不会被发现。

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.

缪败 2024-10-04 22:15:27

我认为您在这里面临的问题要么是可执行文件的用户权限,要么是错误的构建路径。

首先,尝试将“项目”-“常规”-“构建目录”下的构建路径设置为正确的路径。

如果这不起作用,请打开终端,转到构建路径并执行 ./QtBuildProgram

如果这不起作用,请查看用户权限 ls -a ./ QtBuildProgram

也许未授予可执行权限,因为您正在另一种用户模式下作为终端仿真器运行 Creator。

可以肯定的是,执行 sudo chmod u+x QtBuildProgram ,然后通过键入 ./QtBuildProgram 来从命令行执行程序。

这还应该允许您从再次使用 QtCreator。

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.

能怎样 2024-10-04 22:15:27

就我而言,这是因为我有一个 32 位 CPU 并且它正在构建 64 位可执行文件。我只是在尝试从命令行运行它之后才发现这一点。

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.

百善笑为先 2024-10-04 22:15:27

检查您的运行设置并查看 exe 路径是否存在并且文件是否已在那里构建。如果您运行的是 Windows 7 或 Windows 8,请将 qtcreator 可执行文件的设置设置为“以管理员身份运行”。

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".

迷迭香的记忆 2024-10-04 22:15:27

检查您的防病毒设置。

那是我的问题。

Check your antivirus settings.

That was my issue.

灼疼热情 2024-10-04 22:15:27

就我而言,此错误是由“运行设置”中“工作目录”路径开头的空格引起的。

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

眼睛会笑 2024-10-04 22:15:27

就我而言,此错误是由于防病毒软件阻止运行 exe 文件造成的。我刚刚关闭 Avira Shield 一段时间,它就可以工作了。

In my case, this error was due to antivirus that was blocking to run the exe file. I just turned off the Avira Shield for some time and it worked.

南薇 2024-10-04 22:15:27

就我而言,这是因为我缺少项目顶部的这两行代码。确保它们上面没有任何空格:

#! /usr/bin/env python
# -*- coding: utf-8 -*-

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 -*-
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文