Microsoft visual studio ошибка не удалось запустить программу

Создаю проект: File > New > Project… > Empty Project

Создаю файл: File > New > File.. > C++ File

Пишу стандартную программу «Hello, world!»

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
     cout << "Hello, world!" << endl;
     system("pause");
     return 0;
}

Жму ctrl+f5. Идёт построение, ошибок в коде нет, но выскакивает ошибка «не удаётся запустить программу «путь до exe файла» Не удаётся найти указанный файл.

Скриншот

Самого exe файла по этому пути нет, он даже не создаётся.

Буду признателен за вашу помощь.

  • Remove From My Forums
  • Вопрос

  • Только начал обучение С++ по учебнику Страуструпа.
    Загрузил Visual Studio

    Начал со стандартного «Hello, World!» 

    Отладка проходит успешно, ошибок нет.

    Однако программа не запускается. 

    Выходят следующие сообщения:

    Следующий проект устарел: Hello, World — Debug Win32

    Не удается запустить программу: …/HelloWorld.exe
    Не удается найти указанный файл

    Что я делаю не так?

    Система: Wind x64.

Ответы

  • Книга нашего дорогого и горячо любимого Страуструпа написана о языке программирования, а не о работе в среде разработки Visual Studio. Последнее описано в справочной системе (в крайнем случае, есть сайт msdn.microsoft.com/library).
    Советую там ознакомиться с технологией создания проекта VC++ и процедурой преобразования исходного кода в исполняемый модуль.

    • Изменено

      20 ноября 2013 г. 5:37

    • Помечено в качестве ответа
      Maksim MarinovMicrosoft contingent staff, Moderator
      2 декабря 2013 г. 7:42

While using Visual Studio in Windows 11/10, if you get Unable to start programThe system cannot find the file specified error; try solutions to get rid of the issue. There could be several reasons why this error might occur on your computer. This article explains some of the common causes along with solutions to troubleshoot the issue within moments.

Visual Studio, Unable to start program, The system cannot find the file specified

To fix Unable to start program, The system cannot find the file specified error in Visual Studio, follow these steps:

  1. Restart Visual Studio
  2. Verify the project file
  3. Run as administrator
  4. Add exclusion in antivirus
  5. Reset Visual Studio

To know more about these steps, keep reading.

1] Restart Visual Studio

At times, it could be a glitch or bug which is causing such an issue on your computer. In most cases, such problems get resolved when you restart the computer. However, in this situation, you need to restart the Visual Studio application. Whether you have an open project or not, you can easily restart this program on your computer. If you have an opened project on your screen, you can save everything and then do as said. Once done, you might be able to use all the options as usual.

If it doesn’t do anything positive, you can follow the subsequent tips and tricks.

2] Verify the project file

Let’s assume that you have deleted the project file from the respective directory after opening it in Visual Studio. It may have happened by mistake. If so, there is a very high chance of getting such an error on your computer. That is why it is highly recommended to verify if the project files are intact or not.

If yes, you can follow the other solutions. However, if there is some issue, you need to rectify it first. In some cases, you might need to recover the deleted project files in order to troubleshoot the aforementioned issue.

3] Run as administrator

Visual Studio, Unable to start program, The system cannot find the file specified

There could be times when you might need to run the Visual Studio with administrator privileges in order to compile a program or debug it. In general, administrator permission may not be required. However, if the aforementioned error appears, it is better to run the program with administrator permission.

To run Visual Studio as an administrator, follow these steps:

  • Click on the Start Menu.
  • Search for visual studio.
  • Right-click on the corresponding search result.
  • Click the Run as administrator option.
  • Click on the Yes button in the UAC prompt.

Following that, check if it resolves your issue or not.

4] Add exclusion in antivirus

If the project file is flagged by the antivirus, it may have been quarantined already. If so, you cannot use those files even though they are opened on Visual Studio. That is why it is recommended to check if your project files have been flagged by your antivirus or not. If yes, you need to add an exclusion for those files in your antivirus app. If you use Windows Security, you can follow this guide to add a folder to the exclusions list.

Related: Visual Studio, Unable to start program, Access is denied

5] Reset Visual Studio

Visual Studio, Unable to start program, Access is denied

If you have changed a lot of things incorrectly, this error could appear on your computer. That is why follow these steps to reset Visual Studio in Windows 11/10:

  • Click on the Tools menu.
  • Select the Import and Export Settings.
  • Choose the Reset all settings option.
  • Click the Next button.
  • Choose the No, just reset settings, overwriting my current settings option.
  • Click the Next button.
  • Click the Finish button.

Then, check if it has solved your issue or not.

Read: Visual Studio Installer is stuck on Downloading

How do you fix The system cannot find the file specified?

To fix The system cannot find the file specified error in Visual Studio, you can follow the aforementioned solutions. It appears mainly because of the antivirus blocking your project file. However, at times, it could appear due to the lack of administrator credentials as well.

Read: Visual Studio, Unable to start program, Access is denied

What does The system cannot find the file specified mean?

The system cannot find the file specified error implies that Visual Studio could not recognize the project file or the executable file in the predefined directory. It may appear due to corrupt project files, antivirus, firewall, etc. If you see this issue on your computer, you can follow these solutions to troubleshoot it within moments.

That’s all! Hope this guide helped.

Read: Fix error 0x80070666 when installing Microsoft Visual C++.

Создаю проект: File > New > Project… > Empty Project

Создаю файл: File > New > File.. > C++ File

Пишу стандартную программу «Hello, world!»

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
     cout << "Hello, world!" << endl;
     system("pause");
     return 0;
}

Жму ctrl+f5. Идёт построение, ошибок в коде нет, но выскакивает ошибка «не удаётся запустить программу «путь до exe файла» Не удаётся найти указанный файл.

Скриншот

Самого exe файла по этому пути нет, он даже не создаётся.

Буду признателен за вашу помощь.

  • Remove From My Forums
  • Вопрос

  • Только начал обучение С++ по учебнику Страуструпа.
    Загрузил Visual Studio

    Начал со стандартного «Hello, World!» 

    Отладка проходит успешно, ошибок нет.

    Однако программа не запускается. 

    Выходят следующие сообщения:

    Следующий проект устарел: Hello, World — Debug Win32

    Не удается запустить программу: …/HelloWorld.exe
    Не удается найти указанный файл

    Что я делаю не так?

    Система: Wind x64.

Ответы

  • Книга нашего дорогого и горячо любимого Страуструпа написана о языке программирования, а не о работе в среде разработки Visual Studio. Последнее описано в справочной системе (в крайнем случае, есть сайт msdn.microsoft.com/library).
    Советую там ознакомиться с технологией создания проекта VC++ и процедурой преобразования исходного кода в исполняемый модуль.

    • Изменено

      20 ноября 2013 г. 5:37

    • Помечено в качестве ответа
      Maksim MarinovMicrosoft contingent staff, Moderator
      2 декабря 2013 г. 7:42

I installed Visual Studio 2010. I wrote a simple code which I’m sure is correct but unfortunately, when I run the code, I get the error below.

Here is my code:

#include<iostream>
using namespace std;
int main (){ 
  cout <<"Hello StackOverFlow ;)";
  return 0;
}

And here is the error:

Unable to start program ‘C:UsersSoheilDesktopNew foldersamDebugsam.exe
The system cannot find the file specified

Would you help me solve the issue? Should I define the project in a
specific directory? I’ve spent a ton of hours to solve this issue and
have not had any success yet.

pmr's user avatar

pmr

57.7k10 gold badges110 silver badges155 bronze badges

asked May 12, 2013 at 20:51

Sam's user avatar

21

This is a first step for somebody that is a beginner. Same thing happened to me:

Look in the Solution Explorer box to the left. Make sure that there is actually a .cpp file there. You can do the same by looking the .cpp file where the .sln file for the project is stored. If there is not one, then you will get that error.

When adding a cpp file you want to use the Add new item icon. (top left with a gold star on it, hover over it to see the name) For some reason Ctrl+N does not actually add a .cpp file to the project.

Frank Fajardo's user avatar

answered Nov 9, 2013 at 17:44

cdelsola's user avatar

cdelsolacdelsola

3972 gold badges7 silver badges17 bronze badges

1

Encountered the same issue, after downloading a project, in debug mode. Searched for hours without any luck. Following resolved my problem;

Project Properties -> Linker -> Output file -> $(OutDir)$(TargetName)$(TargetExt)

It was previously pointing to a folder that MSVS wasn’t running from whilst debugging mode.

EDIT: soon as I posted this I came across: unable to start «program.exe» the system cannot find the file specified vs2008 which explains the same thing.

Community's user avatar

answered Mar 20, 2016 at 5:51

ReturnVoid's user avatar

ReturnVoidReturnVoid

1,0711 gold badge10 silver badges17 bronze badges

0

I know this is an old thread, but for any future visitors, the cause of this error is most likely because you haven’t built your project from Build > Build Solution. The reason you’re getting this error when you try to run your project is because Visual Studio can’t find the executable file that should be produced when you build your project.

answered Oct 31, 2015 at 16:14

Ethan Bierlein's user avatar

Ethan BierleinEthan Bierlein

3,2534 gold badges27 silver badges41 bronze badges

1

As others have mentioned, this is an old thread and even with this thread there tends to be different solutions that worked for different people. The solution that worked for is as follows:

Right Click Project Name > Properties
Linker > General 
Output File > $(OutDir)$(TargetName)$(TargetExt) as indicated by @ReturnVoid
Click Apply

For whatever reason this initial correction didn’t fix my problem (I’m using VS2015 Community to build c++ program). If you still get the error message try the following additional steps:

Back in Project > Properties > Linker > General > Output File > 

You’ll see the previously entered text in bold

Select Drop Down > Select "inherit from parent or project defaults"
Select Apply

Previously bold font is no longer bold

Build > Rebuild > Debug

It doesn’t make since to me to require these additional steps in addition to what @ReturnVoid posted but…what works is what works…hope it helps someone else out too. Thanks @ReturnVoid

answered Apr 9, 2016 at 22:24

Chris's user avatar

ChrisChris

9241 gold badge16 silver badges37 bronze badges

1

I came across this problem and none of these solution worked 100%

In addition to ReturnVoid’s answer which suggested the change

Project Properties -> Linker -> Output file -> $(OutDir)$(TargetName)$(TargetExt)

I needed to changed

Project Properties -> C/C++ -> Debug Information Format -> /Zi

This field was blank for me, changing the contents to /Zi (or /Z7 or /ZI if those are the formats you want to use) allowed me to debug

answered Jan 9, 2019 at 15:58

rtpax's user avatar

rtpaxrtpax

1,64716 silver badges31 bronze badges

For me, I didn’t have my startup project set in Solution Explorer.

Go to Solution Explorer on the left of VS, right click your unit test project, and choose «set as startup project».

I had just ported my code to a new workspace, and forgot that when I opened the project in VS in the solution there, that I needed to re-set my startup project.

answered Apr 11, 2017 at 15:35

Michele's user avatar

MicheleMichele

3,42411 gold badges44 silver badges79 bronze badges

I know this thread is 1 year old but I hope this helps someone, my problem was that I needed to add:

    #include "stdafx.h"

to my project (on the first line), this seems to be the case most of the time!

Toastrackenigma's user avatar

answered May 28, 2014 at 0:25

Windows65's user avatar

Windows65Windows65

571 silver badge7 bronze badges

2

I got this problem during debug mode and the missing file was from a static library I was using. The problem was solved by using step over instead of step into during debugging

answered Apr 26, 2019 at 0:25

misty's user avatar

mistymisty

111 silver badge4 bronze badges

if vs2010 installed correctly

check file type (.cpp)

just build it again It will automatically fix,, ( if you are using VS 2010 )

answered Aug 12, 2014 at 12:35

ANJi's user avatar

ANJiANJi

278 bronze badges

I had a same problem and i could fixed it!
you should add
C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64 for 64 bit system
/ C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib for 32 bit system
in property manager-> Linker-> General->Additional library Directories

maybe it can solve the problem of somebody in the future!

answered Sep 6, 2014 at 15:26

hani89's user avatar

I installed Visual Studio 2010. I wrote a simple code which I’m sure is correct but unfortunately, when I run the code, I get the error below.

Here is my code:

#include<iostream>
using namespace std;
int main (){ 
  cout <<"Hello StackOverFlow ;)";
  return 0;
}

And here is the error:

Unable to start program ‘C:UsersSoheilDesktopNew foldersamDebugsam.exe
The system cannot find the file specified

Would you help me solve the issue? Should I define the project in a
specific directory? I’ve spent a ton of hours to solve this issue and
have not had any success yet.

pmr's user avatar

pmr

57.7k10 gold badges110 silver badges155 bronze badges

asked May 12, 2013 at 20:51

Sam's user avatar

21

This is a first step for somebody that is a beginner. Same thing happened to me:

Look in the Solution Explorer box to the left. Make sure that there is actually a .cpp file there. You can do the same by looking the .cpp file where the .sln file for the project is stored. If there is not one, then you will get that error.

When adding a cpp file you want to use the Add new item icon. (top left with a gold star on it, hover over it to see the name) For some reason Ctrl+N does not actually add a .cpp file to the project.

Frank Fajardo's user avatar

answered Nov 9, 2013 at 17:44

cdelsola's user avatar

cdelsolacdelsola

3972 gold badges7 silver badges17 bronze badges

1

Encountered the same issue, after downloading a project, in debug mode. Searched for hours without any luck. Following resolved my problem;

Project Properties -> Linker -> Output file -> $(OutDir)$(TargetName)$(TargetExt)

It was previously pointing to a folder that MSVS wasn’t running from whilst debugging mode.

EDIT: soon as I posted this I came across: unable to start «program.exe» the system cannot find the file specified vs2008 which explains the same thing.

Community's user avatar

answered Mar 20, 2016 at 5:51

ReturnVoid's user avatar

ReturnVoidReturnVoid

1,0711 gold badge10 silver badges17 bronze badges

0

I know this is an old thread, but for any future visitors, the cause of this error is most likely because you haven’t built your project from Build > Build Solution. The reason you’re getting this error when you try to run your project is because Visual Studio can’t find the executable file that should be produced when you build your project.

answered Oct 31, 2015 at 16:14

Ethan Bierlein's user avatar

Ethan BierleinEthan Bierlein

3,2534 gold badges27 silver badges41 bronze badges

1

As others have mentioned, this is an old thread and even with this thread there tends to be different solutions that worked for different people. The solution that worked for is as follows:

Right Click Project Name > Properties
Linker > General 
Output File > $(OutDir)$(TargetName)$(TargetExt) as indicated by @ReturnVoid
Click Apply

For whatever reason this initial correction didn’t fix my problem (I’m using VS2015 Community to build c++ program). If you still get the error message try the following additional steps:

Back in Project > Properties > Linker > General > Output File > 

You’ll see the previously entered text in bold

Select Drop Down > Select "inherit from parent or project defaults"
Select Apply

Previously bold font is no longer bold

Build > Rebuild > Debug

It doesn’t make since to me to require these additional steps in addition to what @ReturnVoid posted but…what works is what works…hope it helps someone else out too. Thanks @ReturnVoid

answered Apr 9, 2016 at 22:24

Chris's user avatar

ChrisChris

9241 gold badge16 silver badges37 bronze badges

1

I came across this problem and none of these solution worked 100%

In addition to ReturnVoid’s answer which suggested the change

Project Properties -> Linker -> Output file -> $(OutDir)$(TargetName)$(TargetExt)

I needed to changed

Project Properties -> C/C++ -> Debug Information Format -> /Zi

This field was blank for me, changing the contents to /Zi (or /Z7 or /ZI if those are the formats you want to use) allowed me to debug

answered Jan 9, 2019 at 15:58

rtpax's user avatar

rtpaxrtpax

1,64716 silver badges31 bronze badges

For me, I didn’t have my startup project set in Solution Explorer.

Go to Solution Explorer on the left of VS, right click your unit test project, and choose «set as startup project».

I had just ported my code to a new workspace, and forgot that when I opened the project in VS in the solution there, that I needed to re-set my startup project.

answered Apr 11, 2017 at 15:35

Michele's user avatar

MicheleMichele

3,42411 gold badges44 silver badges79 bronze badges

I know this thread is 1 year old but I hope this helps someone, my problem was that I needed to add:

    #include "stdafx.h"

to my project (on the first line), this seems to be the case most of the time!

Toastrackenigma's user avatar

answered May 28, 2014 at 0:25

Windows65's user avatar

Windows65Windows65

571 silver badge7 bronze badges

2

I got this problem during debug mode and the missing file was from a static library I was using. The problem was solved by using step over instead of step into during debugging

answered Apr 26, 2019 at 0:25

misty's user avatar

mistymisty

111 silver badge4 bronze badges

if vs2010 installed correctly

check file type (.cpp)

just build it again It will automatically fix,, ( if you are using VS 2010 )

answered Aug 12, 2014 at 12:35

ANJi's user avatar

ANJiANJi

278 bronze badges

I had a same problem and i could fixed it!
you should add
C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64 for 64 bit system
/ C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib for 32 bit system
in property manager-> Linker-> General->Additional library Directories

maybe it can solve the problem of somebody in the future!

answered Sep 6, 2014 at 15:26

hani89's user avatar

I have a solution in C:full path hereVS2010blender.sln

This solution contains many projects(around 100). When I compile them, they all work fine. I can run them without any problem, and (quite) everything works (there are some bugs).
One of the projects is ALL_BUILD, but it gives the same error if I try to debug INSTALL(another project). I’m compiling with RELWithDebInfo as configuration, and if I execute the program manually it works. It is outputted in C:full path hereVS2010binRelWithDebInfo

But if I try to run the compiler, it says

«Unable to start program
C:full path hereVS2010RelWithDebInfoALL_BUILD
Specified file cannot be found»

I tried to copy the compiled program into the path required by VS, but it raised the same error.

What should I do to solve this? Right now I set up cmake to generate also a mingw project and I compile it and debug it with gdb, but this is a really a slow and impractical workflow, and I would like to use the VS debugger.

I must say that if I compile with Debug as configuration, the program doesn’t even start.

I’m using VS2010 Express on Win7 64bit

(This is a big open source program, so I don’t know exactly whatever it does)

I have a solution in C:full path hereVS2010blender.sln

This solution contains many projects(around 100). When I compile them, they all work fine. I can run them without any problem, and (quite) everything works (there are some bugs).
One of the projects is ALL_BUILD, but it gives the same error if I try to debug INSTALL(another project). I’m compiling with RELWithDebInfo as configuration, and if I execute the program manually it works. It is outputted in C:full path hereVS2010binRelWithDebInfo

But if I try to run the compiler, it says

«Unable to start program
C:full path hereVS2010RelWithDebInfoALL_BUILD
Specified file cannot be found»

I tried to copy the compiled program into the path required by VS, but it raised the same error.

What should I do to solve this? Right now I set up cmake to generate also a mingw project and I compile it and debug it with gdb, but this is a really a slow and impractical workflow, and I would like to use the VS debugger.

I must say that if I compile with Debug as configuration, the program doesn’t even start.

I’m using VS2010 Express on Win7 64bit

(This is a big open source program, so I don’t know exactly whatever it does)

19 / 19 / 6

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

Сообщений: 84

1

«Не удаётся найти указанный файл» после запуска программы

22.03.2011, 16:26. Показов 154768. Ответов 35


в Microsoft Visual Studio 2008 при попытке запуска программы выходит сообщение «Не удаётся запустить программу» дальше путь к файлу вернее где он должен быть и дальше «Не удаётся найти указанный файл»
когда захожу в папку в которой по умолчанию сохраняются проекты там *exe файла нет..

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

0

Brainsbreaker

896 / 372 / 52

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

Сообщений: 1,592

22.03.2011, 19:27

2

Поподробней, можно со скрином…

0

Делаю внезапно и красиво

Эксперт С++

1312 / 1227 / 72

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

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

22.03.2011, 19:43

3

Раз файла нет, то он не был скомпонован. Или рабочая директория отличается от той, в которую файл собирался.

0

374 / 321 / 32

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

Сообщений: 1,512

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

22.03.2011, 20:29

4

Проект то компилируется нормально? Если нет, то что говорит?

0

19 / 19 / 6

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

Сообщений: 84

24.03.2011, 18:54

 [ТС]

5

Сначало создаю пустой проект С++ затем создаю файл С++ , пишу программу нажимаю F5 дальше появляется окно которое рис 1 нажимаю «да» и появлется ошибка рис 2
вот картинка Скачать файл 1.jpg
это происходит при любом коде..

0

Делаю внезапно и красиво

Эксперт С++

1312 / 1227 / 72

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

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

24.03.2011, 19:11

6

Нажми Ф7, а не Ф5.

0

374 / 321 / 32

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

Сообщений: 1,512

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

24.03.2011, 19:12

7

Не по теме:

А что, картинку к сообщению прикрепить не судьба

Вы не F5 нажимайте, а если проект в решении один, то F7. Или правой кнопкой по названию проекта в Обозревателе решения и Построение. В окне Вывода (внизу) будут перечислены ошибки. Выделите все, скопируйте и сюда. Да и код тоже.

0

Делаю внезапно и красиво

Эксперт С++

1312 / 1227 / 72

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

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

24.03.2011, 19:19

8

F7 — компиляция
F5 — (не всегда)компиляция и запуск на отладку
Смотря как студия настроена.

0

Антон555

19 / 19 / 6

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

Сообщений: 84

24.03.2011, 19:28

 [ТС]

9

C++
1
2
3
4
5
6
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello World" << endl;
}

то что внизу

1>Внедрение манифеста…
1>mt.exe : general error c10100b1: Failed to load file «..Debug5.exe». !8AB5<5 =5 C405BAO =09B8 C:070==K9 ?CBL.
1>Журнал построения был сохранен в «file://c:Project C++55DebugBuildLog.htm»
1>5 — ошибок 1, предупреждений 0
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========

0

Делаю внезапно и красиво

Эксперт С++

1312 / 1227 / 72

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

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

24.03.2011, 19:33

10

5 — ошибок
И в чём вопрос? Исправляйте ошибки. Читайте c:Project C++55DebugBuildLog.htm.

Добавлено через 28 секунд
ехе появится только после компиляции без ошибок.

0

19 / 19 / 6

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

Сообщений: 84

24.03.2011, 19:38

 [ТС]

11

вопрос в том, что так происходит при любом коде, перепробывал много исходников… может какие то настройки виноваты..

0

Делаю внезапно и красиво

Эксперт С++

1312 / 1227 / 72

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

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

24.03.2011, 19:40

12

Манифест создан? Раз это последняя вменяемая строка, возможно на его внедрении и падает.

1

19 / 19 / 6

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

Сообщений: 84

24.03.2011, 19:45

 [ТС]

13

Всё получилось, спасибо.

0

bigredcat

374 / 321 / 32

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

Сообщений: 1,512

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

24.03.2011, 19:46

14

Вы один фиг F5 нажимаете.

C++
1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello World" << endl;
    return 0;
}

0

19 / 19 / 6

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

Сообщений: 84

24.03.2011, 19:47

 [ТС]

15

Спасибо, всё получилось. А что за манифест? (извеняюсь если вопрос очень глупый)=)

0

Dmitrii9999

27.04.2011, 12:38

16

Антон555, так как ты решил проблему,а то у меня тоже такая

0 / 0 / 0

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

Сообщений: 3

27.10.2011, 18:25

17

у мене тоже похожая ошибка токо после того как я нажимаю Ф7 у меня сразу начинает перезагружатся программа

0

2 / 2 / 0

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

Сообщений: 35

09.11.2012, 17:37

18

Как проблему то решили?

0

6 / 6 / 5

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

Сообщений: 95

03.12.2012, 23:04

19

ну вот а ответа как решить проблему нема((( ужас то какой та же самая проблема

0

Nirvanovec

25 / 31 / 22

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

Сообщений: 322

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

23.12.2012, 11:35

20

[cut]
говори как исправил!!!

Добавлено через 4 минуты
вот как я решил этупроблему
измените
#include<iostream> на #include «stdafx.h»
все нормально работает

C++ (Qt)
1
2
3
4
5
6
7
8
#include "stdafx.h"
using namespace std;
 
int main()
{
    cout << "Hello World" << endl;
    return 0;
}

0

IT_Exp

Эксперт

87844 / 49110 / 22898

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

Сообщений: 92,604

23.12.2012, 11:35

20

При отладке программы, если вы получаете Невозможно запустить программу, Доступ запрещен ошибка, вот как вы можете избавиться от проблемы. Эта ошибка может возникать в Visual Studio 2019, а также Visual Studio 2022. Если вы получите эту проблему на Windows 11, Windows 10, или любые другие более старые версии, вы можете воспользоваться этими решениями для устранения проблемы.

Visual Studio, не удается запустить программу, доступ запрещен

Чтобы исправить ошибку «Невозможно запустить программу, доступ запрещен» в Visual Studio, выполните следующие действия:

  1. Проверьте с учетной записью администратора
  2. Выберите правильный файл для компиляции
  3. Запустить установщик с другого диска
  4. Отключить сторонний брандмауэр и антивирус
  5. Сбросить Visual Studio

Чтобы узнать больше об этих шагах, продолжайте читать.

1] Проверьте с учетной записью администратора

Иногда вам может понадобиться использовать учетную запись администратора для запуска проекта в Visual Studio в Windows 11 или Windows 10 ПК. Независимо от того, какой язык вы использовали, вам нужно выбрать учетную запись администратора, чтобы избавиться от этой проблемы. Если вы сейчас используете стандартную учетную запись, вам необходимо выйти из этой учетной записи и начать использовать учетную запись администратора.

Существует два основных способа создания учетной записи администратора в Windows 11/10 шт. Вы можете включить скрытую учетную запись администратора or создать локальную учетную запись администратора. Вы можете следовать любому методу, чтобы выполнить работу. Вслед за этим вам необходимо войдите как администратор для устранения проблемы.

2] Выберите правильный файл для компиляции

В большинстве случаев пользователи забывают выбрать правильный файл проекта для компиляции. В результате они сталкиваются с такой проблемой при отладке в Visual Studio. Если вы работали над одним проектом раньше, а потом переключились на другой, это может быть распространенной ошибкой. Вот почему настоятельно рекомендуется проверить правильный файл проекта перед повторной попыткой.

3] Запустите установщик с другого диска

Если вы установили Visual Studio на другом диске, отличном от системного или диска C, вам нужно запустить программу установки только с этого диска. Время от времени ваш компьютер может не делать все, когда вы устанавливаете программу на другой диск. Хотя это не должно быть проблемой, поскольку Windows может запускать программы с любого диска, Visual Studio может вызвать у вас проблемы по этой причине. Вот почему вы можете следовать этому пошаговому руководству, чтобы переместить установленные программы на другой диск без потери данных in Windows 11 / 10.

4] Отключите сторонний брандмауэр и антивирус

Windows Безопасность не создает проблем с Visual Studio, поскольку они очень совместимы друг с другом. Однако, если вы используете сторонний брандмауэр или антивирусную программу на своем компьютере, вы можете столкнуться с этой проблемой. Вот почему рекомендуется временно отключить брандмауэр и антивирусную программу, чтобы проверить, решает ли это проблему или нет.

Если да, вы можете попробовать сбросить эти программы и проверить еще раз. Если это не решит проблему, вам нужно избавиться от этих приложений, чтобы использовать Visual Studio без каких-либо ошибок.

Похожие страницы:: Visual Studio, Невозможно запустить программу, Системе не удается найти указанный файл

5] Сбросить Visual Studio

Чтобы сбросить Visual Studio в Windows 11/10 выполните следующие действия:

  • Откройте Visual Studio на своем компьютере.
  • Нажмите на Инструменты меню.
  • Выберите Импорт и экспорт Вариант настроек.
  • Выберите Сбросить все настройки опцию.
  • Нажмите Далее кнопку.
  • Выберите Да, сохранить мои текущие настройки возможность сохранить текущую настройку.
  • Выберите Нет, просто сбросить настройки возможность сбросить все.
  • Нажмите Далее кнопку.
  • Нажмите на Завершить кнопку.

После этого проверьте, есть ли проблема или нет.

Читайте: Установщик Visual Studio зависает при загрузке

Как исправить отказ в доступе в Visual Studio?

Для того, чтобы исправить Доступ запрещен ошибка в Visual Studio, вам необходимо воспользоваться вышеупомянутыми решениями. Во-первых, проверьте, есть ли у вас учетная запись администратора или нет. После этого не забудьте проверить настройки брандмауэра и антивируса. С другой стороны, вам может потребоваться восстановить настройки в Windows Реестр, чтобы избавиться от этой проблемы.

Как запустить Visual Studio от имени администратора?

Чтобы запустить Visual Studio от имени администратора в Windows 11 или Windows 10, вы можете использовать меню «Пуск». Тем не менее, нажмите на меню «Пуск» и найдите визуальная студия. Увидев результат поиска, убедитесь, что выбрана Visual Studio. Если это так, нажмите на Запуск от имени администратора и нажмите Да в командной строке UAC.

Оригинал статьи

Возможно, вам также будет интересно:

  • Microsoft visual foxpro ошибка что это
  • Microsoft visual c ошибка при запуске компьютера
  • Microsoft visual c ошибка доступа
  • Microsoft visual c ошибка 80070666
  • Microsoft visual c ошибка 2203

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

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