Меню

1 ошибка cannot open output file debug untitled exe permission denied

8 / 8 / 0

Регистрация: 05.11.2011

Сообщений: 81

1

Не получается собрать проект

08.04.2012, 11:53. Показов 10901. Ответов 7


Не могу собрать проект по теме «Qt-руководство для начинающих».Пункт 2.2.
Выводит 2 ошибки:
cannot open output file debugfirst.exe:Permission denied.
collect2:id returned 1 exit status.Помогите

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

08.04.2012, 11:53

7

159 / 152 / 50

Регистрация: 03.08.2011

Сообщений: 299

Записей в блоге: 14

08.04.2012, 12:00

2

А у вас экзешник, случаем, не запущен?



1



8 / 8 / 0

Регистрация: 05.11.2011

Сообщений: 81

08.04.2012, 12:09

 [ТС]

3

Какой exe-шник?Я открыл Диспетчер задач и не нашёл first.exe.
Когда удаляю exe-шник и собираю заново-всё получается.
Иначе никак. Объясните мне кто-нибудь,почему это так,а то я никак не пойму



0



Почетный модератор

11291 / 4260 / 436

Регистрация: 12.06.2008

Сообщений: 12,277

08.04.2012, 12:19

4

Возможно, какой-то процесс его открывает для чтения или просто блокирует. Может, антивирус глючит. Посмотри через программу Unlocker, какой процесс занимает твой exe’шник.



0



35 / 35 / 1

Регистрация: 02.03.2012

Сообщений: 117

08.04.2012, 12:50

5

Кстати, у меня тоже был такой косяк, когда ставил себе 4.7.0. Постоянно приходилось удалять exe файл, чтобы откомпилить снова



0



8 / 8 / 0

Регистрация: 05.11.2011

Сообщений: 81

08.04.2012, 13:02

 [ТС]

6

kniferko, а как ты его решил?



0



35 / 35 / 1

Регистрация: 02.03.2012

Сообщений: 117

08.04.2012, 13:29

7

честно говоря, как-то само решилось по себе через недельку другую после очередного запуска компа



1



Автор FAQ

2732 / 1428 / 89

Регистрация: 08.09.2011

Сообщений: 3,746

Записей в блоге: 1

08.04.2012, 15:40

8

вероятнее все дебагер не выгрузился и хоть процесса нет дебагер ссылается на ехе файл и в результате креатор не может его заменить на новый скомпилированый



1



So I keep getting this error when trying to compile C++ code using CodeBlocks.

cannot open output file [filename.exe] permission denied

It only started today, and it’s sporadic and inconsistent. It usually goes away if I shut CodeBlocks down and restart the project, but not always. Sometimes it even goes away when I just press F9 (build & run) several times. I always check Task Manager, but there are never any .EXEs running with my file’s name, or anything related to it.

I’ve also noticed that if this problem occurs and I then try to delete the .EXE manually or otherwise interact with it, Windows tells me I need administrator permission to do so (this is a private PC, and as far as I know I am an administrator on it).

The first time it occurred, the only thing I had added to the code beyond what was in the previous version was a debugging report sent to cout — hardly anything arcane. It sometimes occurs even when no code was changed from a previous version.

What could this be? It’s not game-breaking, yet, but it’s irritating and I’d rather it didn’t get worse.

EDIT: This is old by now, but just in case anyone else is having similar problems, the workaround I currently use is just to consistently delete [filename.exe] before trying to run the code again. This avoids the problem, though it is annoying.

6th December 2019, 00:03


#1

Default cannot open output file debugFilename: Permission denied

On Windows 7 I was using Qt 5.12.6 with Qt Creator 4.10.2 IDE and compiling with MinGW 64-bit utilizing the provided qmake, on Windows 7. I ran into an interesting situation.

When attempting to compile and debug a project, Qt Creator started giving the following message

:-1: error: cannot open output file debugTestFlight.exe: Permission denied
collect2.exe:-1: error: error: ld returned 1 exit status


Assuming that the program somehow was not shut down correctly, I could not find any reference to the program using the task manager, so I attempted to see if it would run stand-alone, which just resulted in the following…

Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

This appeared odd seeing as I have full administrative permissions and I should be the owner of the file. So I attempted to access the permissions of the file to see what exactly was going on by highlighting the file and taking the following steps…

1 Right clicked the file
2 Selected properties
3 Selected the security tab which then caused a new window to pop up with the following statement…

To continue, you must be an administrative user with permission to view this object’s security properties

4 Clicked Continue

A window then popped up displaying a message stating that I do not have permission to view the object’s security properties along with a section that should have displayed the owner information and another section with a list of users. However in the current owner section, it simply stated…

Unable to display current owner. To try taking ownership of the object select an account from the list, and then click OK.

5 There were two accounts in the list. Both of them were mine and they both had admin privileges. I attempted to change the owner using both accounts and each time a window popped up and sated…

Unable to set new owner on file name.
Access is denied


without any further explanation.

I’m somewhat confused on this one since I have full admin privileges and it doesn’t let me change, access, or even delete the file. I have run the Build->Clean All and Build->Run qmake options from the menu with out any effect on the outcome. So I rebuilt the whole program and attempted it again.

The rebuilt program compiled and ran just fine and did not exhibit any of the signs or problems experienced on prior attempts. When I checked the executable in the debug directory I was able to access the parameters and security settings of the file and I was listed as the owner. So after some minor coding changes, I checked the executable file in the debug directory again, and everything was as it should be. I felt it was fine to go ahead and attempt to compile it again.

Unfortunately, during the compile the same issues were reported by Qt Creator as with the prior build…

:-1: error: cannot open output file debugTestFlight.exe: Permission denied
collect2.exe:-1: error: error: ld returned 1 exit status


In addition to searching in the Task Manager and Process Explorer I’ve rebuilt this program several times, changed directories, scoured the operating system environment for anomalies, and shut down any other programs that were running. and yet I’m still getting the same results. I searched for and found a multitude of similar situations on several programming boards (including this one) but there have been no satisfactory solutions with the exception that some individuals seem to have found that turning on “Application Experience” in Windows seems to resolve the issue. Unfortunately, this appears to be a feature that is not in Windows 7. I’ve run out of things that I know to check for. I strongly suspect that this may be a problem minGW or maybe Windows, but if anyone has any insight on this issue, it would be highly appreciated.


6th December 2019, 18:23


#2

Default Re: cannot open output file debugFilename: Permission denied

I have occasionally come across a similar problem using Visual Studio in Windows 10, so I don’t think it is specifically a Qt Creator problem. What I surmise happens is that the build locks the output file and that this lock doesn’t get released. In VS and probably in Qt, builds can be multithreaded, so there could be a bug resulting in a race condition or other fault that sometimes keeps the lock from being properly released.

With Visual Studio, closing and restarting VS has often cleared things up. Sometimes it has taken a reboot if there is some dangling VS process left behind after closing it.

There is a new security feature that has recently been added to Windows 10, which prevents apps from writing to or changing files in certain «protected» directories without explicit permission, including Microsoft’s own programs, like Visual Studio and MS Office that are now blocked from updating the default options files in your App Data folders. Your choices are either to turn it off completely and risk a malware attack, or to go into Window security for every program you use, find out where it is trying to write, and add it to the list of allowed programs. It’s even worse with programs like OpenOffice, which consist of a driver program that fires off child programs to handle each specific document type. You have to add the driver and each of the child programs, individually and manually to the list. Major PITA. My solution has been to change the parameter directories to something I can control if possible.

<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click «Go Advanced» and then the «#» icon to insert the tags. Paste your code between them.


The following user says thank you to d_stranz for this useful post:

Corny (6th December 2019)


22nd March 2021, 15:38


#3

Default Re: cannot open output file debugFilename: Permission denied

Good morning Earth,

I had the same issue on my Windows 10 box, and the guilty was the antivirus : by disabling temporary my Kaspersky antivirus, I was able to successfully compile and run my Qt project.

Bonjour chez vous !

JPL


22nd March 2021, 16:43


#4

Default Re: cannot open output file debugFilename: Permission denied

Yes. After this happened to me several times, I discovered that anti-virus software (Malwarebytes in my case) was incorrectly classifying the exe file as malware and was quarantining it. So the file would be written and as soon as the debugger would try to run it, the anti-virus software would delete it. I could watch the file appear in the output folder, then just as quickly it would disappear. For some reason, debug mode Qt apps seem to trigger anti-virus software occasionally.

The solution was to «white-list» the exe so Malwarebytes would ignore it. I don’t recommend totally disabling your anti-virus software, because you might forget to turn it back on after you have finished debugging.

<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click «Go Advanced» and then the «#» icon to insert the tags. Paste your code between them.


How to handle Cannot open output file: Permission denied

tags: shell

1. The user and group to which the file itself belongs are inappropriate
 2. The permissions of the file itself are inappropriate
 3. If the above is met or the error is reported, then check the group and permissions of the user belonging to the parent directory, and then go up if the error is reported.
 4. The configuration file needs to have executable permissions to be used, such as the etcd configuration file

Intelligent Recommendation

ls: cannot open directory ‘.’: Permission denied

When using docker to mount a volume on Rethat, I found that the contents of the mount directory could not be viewed in the container.Permission denied The specific operation is as follows: The first t…

Linux can’t open the lock file, Permission Denied

Unable to open lock file / var / lib / redis (insufficient permissions) The solution is as follows: terminal input Re-modify the root password, enter twice enter enter password Proceed as follows: car…

More Recommendation

cannot open output file…

Insufficient root authority Problems encountered in running a program Enter cc-o client.out client.c to prompt that the out file cannot be opened The reason is insufficient system permissions So chang…

Hi All,

I’m trying to compile and run a programm and I constantly receive these two error messages.
error: cannot open output file debugProjektMockUp.exe: Permission denied
error: collect2.exe: error: ld returned 1 exit status

I really don’t know what to do. It started once, crashed, I closed it. I cannot see anything running in the Task Manager, I deactivated my Anti Virus.
Any Idea?
Thanks a lot in advance!

This is what the Compile Output tab provides:

C:/Qt/Qt5.12.8/Tools/mingw730_64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file debugProjektMockUp.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [Makefile.Debug:69: debug/ProjektMockUp.exe] Error 1
mingw32-make[1]: Leaving directory ‘C:/Users/Lukas/Desktop/QT/Arrays/build-ProjektMockUp-Desktop_Qt_5_12_8_MinGW_64_bit-Debug’
mingw32-make: *** [Makefile:38: debug] Error 2
15:42:08: The process «C:QtQt5.12.8Toolsmingw730_64binmingw32-make.exe» exited with code 2.
Error while building/deploying project ProjektMockUp (kit: Desktop Qt 5.12.8 MinGW 64-bit)
When executing step «Make»


Форум программистов Vingrad

Новости ·
Фриланс ·
FAQ

Правила ·
Помощь ·
Рейтинг ·
Избранное ·
Поиск ·
Участники

Поиск:

Ответ в темуСоздание новой темы
Создание опроса
> [QT] Не могу откомпилировать файл 

:(

   

Опции темы

Alexey91
  Дата 25.10.2011, 14:07 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Бывалый
*

Профиль
Группа: Участник
Сообщений: 195
Регистрация: 18.9.2008

Репутация: нет
Всего: нет

Здравствуйте!
Создал пустой проект в QT, присоединил к нему main.cpp, в него скопировал следущее:

Код

#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton *newbtn = new QPushButton(QObject::tr("OK"));
    QObject::connect(newbtn, SIGNAL(clicked()), &app, SLOT(quit()));
    newbtn->resize(180,40);
    newbtn->show();
    return app.exec();
}

У компилятора по коду ошибок не возникает
Выдает следующее:
:-1: error: cannot open output file debugt1.exe: Permission denied
:-1: error: collect2: ld returned 1 exit status

PM   Вверх
Alexey91
Дата 25.10.2011, 14:59 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Бывалый
*

Профиль
Группа: Участник
Сообщений: 195
Регистрация: 18.9.2008

Репутация: нет
Всего: нет

Дело оказалось в том, что приложение уже было открыто. Один раз это помогло, но уже в другом проекте.
А в том старом, не помогает  smile 

PM   Вверх
math64
Дата 25.10.2011, 15:00 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Эксперт
****

Профиль
Группа: Завсегдатай
Сообщений: 2505
Регистрация: 12.4.2007

Репутация: 23
Всего: 72

Скорее всего, программа уже запущена, скорее всего в отладчике. Полагаю, Вы используете Qt Creator? Нажмите внизу кнопку Консоль приложения и закройте в ней все вкладки перед компиляцией.

PM   Вверх



















Ответ в темуСоздание новой темы
Создание опроса
Правила форума «С/С++: Кроссплатформенное программирование, QT/Gtk+/wxWidgets»
JackYF
Любитель
  • В заголовке темы в квадратных скобках обозначьте используемую вами библиотеку, например: [QT],[GTK],[wx].
  • Если вопрос актуален только для некоторой версии библиотеки, либо, если вы пользуетесь не самой последней версией, укажите это. Например: [QT4], [GTK2].
  • Все начинающие изучать Qt — не забудьте зайти сюда.
  • Проставьте несколько ключевых слов темы, чтобы её можно было легче найти.
  • В вопросе укажите полную версию версию библиотеки, а также все дополнительные используемые программные пакеты.
  • Не забывайте пользоваться кнопкой «Код».
  • Телепатов на форуме нет! Задавайте чёткий, конкретный и полный вопрос. Указывайте полностью ошибки компилятора и компоновщика.
  • Новое сообщение должно иметь прямое отношение к тематике этого раздела. Флуд, флейм, оффтопик запрещены.
  • Категорически запрещается обсуждение вареза, «кряков», взлома программ и т.д.

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, JackYF, Любитель.

 

0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | С/С++: Кроссплатформенное программирование, Qt/Gtk+/wxWidgets | Следующая тема »

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • 1 код ошибки тлаунчер
  • 1 класс математика работа над ошибками итоговый контроль