Меню

Microsoft visual studio ошибка не удается найти указанный файл

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

  • Недавно столкнулся с проблемой в Visual Studio : при попытке компиляции программы в конфигурации debug программа завершается с ошибкой «Невозможно найти указанный файл <путь>». До очистки решения
    программа работала верно, .cpp файл в проект включен, все зависимости в свойствах проекта выставлены, все необходимые файлы в папку debug перенесены. Проверял, не запускает с той же ошибкой даже программу первого урока kuchka-pc
    (http://kychka-pc.ru/sfml/urok-1-podklyuchenie-biblioteki-k-srede-razrabotki-visual-studio-2013.html). Подскажите, в чём может быть проблема? Прикладываю код программы с kuchka-pc, тк. он короче.

    #include <iostream>
    #include <windows.h>
    #include <SFML/Graphics.hpp>
    
    using namespace sf;
    
    int main()
    {
    	RenderWindow window(VideoMode(1366, 768), "1");
    	while (window.isOpen())
    	{
    		Event event;
    		while (window.pollEvent(event))
    		{
    			if (Keyboard::isKeyPressed(Keyboard::Escape))
    				window.close();
    		}
    		window.clear();
    		window.display();
    	}
    	return 0;
    }

Ответы

  • Единственная возможноя причина, это то что берутся заголовочные файлы из одной версии SDK, а тулсет из другой. Если есть старые ненужные версии студии, снесите их, и переустановите SDK нужной версии студии.

    • Предложено в качестве ответа

      6 марта 2018 г. 7:51

    • Помечено в качестве ответа
      Maksim MarinovMicrosoft contingent staff, Moderator
      29 марта 2018 г. 9:57

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

1 / 1 / 0

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

Сообщений: 62

1

03.11.2019, 16:25. Показов 17352. Ответов 6


microsoft visual studio 2019 с пол года работал, но сейчас при попытки отладки выскакивает ошибка «Не удаётся запустить программу LL.exe .Не удаётся найти указанный файл»
Создание нового проекта не помогает.

В чём может быть причина и как её устранить ? Так же менял места сохранения файлов проекта.

Добавлено через 1 час 1 минуту
Переустановка не помогла

Добавлено через 33 минуты
Если вручную добавить файл в проект то всё работает.
Но вопрос остаётся открытым: Почему он сам не может это сделать как делал ранее ?

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



0



Эксперт .NET

6266 / 3894 / 1567

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

Сообщений: 9,186

03.11.2019, 16:29

2

Убедитесь что нет ошибок компиляции.



0



1 / 1 / 0

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

Сообщений: 62

03.11.2019, 16:30

 [ТС]

3

Цитата
Сообщение от Someone007
Посмотреть сообщение

Убедитесь что нет ошибок компиляции

Даже при создании нового проекта с Hello World выскакивает эта ошибка.



0



Эксперт С++

3222 / 2481 / 429

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

Сообщений: 5,151

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

05.11.2019, 17:16

4

Цитата
Сообщение от Triglav86
Посмотреть сообщение

Почему он сам не может это сделать как делал ранее ?

я уже говорил, что vs2019 сырое гуамно..
пользуйтесь vs2017 как минимум до весны следующего года, там видно будет.



0



Эксперт .NET

6266 / 3894 / 1567

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

Сообщений: 9,186

06.11.2019, 04:28

5

Цитата
Сообщение от _lunar_
Посмотреть сообщение

я уже говорил, что vs2019 сырое гуамно

Почему-то у меня никаких проблем с VS2019 нет. Тут очень велика вероятность что проблема в прокладке между монитором и креслом.



0



Эксперт С++

3222 / 2481 / 429

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

Сообщений: 5,151

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

06.11.2019, 09:15

6

Цитата
Сообщение от Someone007
Посмотреть сообщение

Тут очень велика вероятность что проблема в прокладке между монитором и креслом.

типа пошутил умник.
если у тебя нет проблем, значит ты не умеешь пользоваться студией — для юзера 0 уровня всё работает хорошо.



1



6574 / 4559 / 1843

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

Сообщений: 13,726

06.11.2019, 10:57

7

Цитата
Сообщение от Triglav86
Посмотреть сообщение

microsoft visual studio 2019 с пол года работал, но сейчас при попытки отладки выскакивает ошибка «Не удаётся запустить программу LL.exe .Не удаётся найти указанный файл»
Создание нового проекта не помогает.

А сам файл-то есть?

Добавлено через 1 минуту
Посмотри, что у тебя прописано в настройках проекта Debugging->Command



0



Я только начал программировать, но у меня продолжают появляться проблемы с заголовками и прочим.
Поэтому всякий раз, когда я пытаюсь запустить код

 // ConsoleApplication4.cpp : Defines the entry point for the console      application.
#include "stdafx.h"#include "std_lib_facilities.h"
int main()
{
return 0;
}

Я получаю это предупреждение, говоря

Невозможно запустить программу ‘C: Users Gebruiker Documents visual studio 2015 Projects ConsoleApplication4 Debug ConsoleApplication4.exe’.
Система не может найти указанный файл.

Кроме того, результаты сборки:

1>------ Build started: Project: ConsoleApplication4, Configuration: Debug Win32 ------
1>ConsoleApplication4.cpp
1>c:program files (x86)microsoft visual studio 14.0vcincludehash_map(17): error C2338: <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========_

Как вы могли заметить, я слежу за книгой Бьярна Страуструпа по этому вопросу, и он вообще не указывает, как с этим бороться.

В любом случае, std_lib_facilities.h заголовок находится в той же папке, что и ConsoleApplication.cpp, так же, как он говорит мне сделать.

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

О да, я должен сказать, что я проверил несколько связанных с этим вопросов, но эти вопросы не соответствовали моим.

Я также пытался #include "../std_lib_facilities.h" а также #include "../../std_lib_facilities.h", без результатов. (То же самое с stdafx.hЯ пытался «собрать» программу, но на самом деле я не знаю, что она делает, и нужно ли мне создавать решение или cpp, и когда отлаживать ….

Ответ, конечно, нет в книге, так как я перешел к главе 8, не выполняя упражнения, потому что я не могу заставить вещь работать.

(Пожалуйста, также скажите мне, если я что-то напутал в этом вопросе, то есть, что мне нужно меньше говорить, дать больше деталей или что-то в этом роде)

1

Решение

Другие решения

Попробуйте создать «новый проект» / консольное приложение C ++; с вашим кодом и без каких-либо включений. — Питер К

Это решило проблему для меня, и я просто скопировал код, и это сработало.

У меня также была ошибка hash_map, потому что она больше не поддерживается в MSVS 2017.
Это особенно происходит потому, что часто все еще можно найти старый заголовок на сайте Бьярна Страуструпа. Вот ссылка на новый заголовок предоставлено Баум Мит Ауген (Обновленная версия Страуструпа)

Если вы используете не заголовок, предоставленный Бьярном Страуструпом, а тот, который вы сделали сами, тот, который вы нашли в Интернете, или тот, который предоставлен в книге, следуйте этот урок из предыдущего ответа WindyFields. (Большое спасибо за это) (Не забудьте проверить их ответ, если это не помогает)

Если вы столкнулись с этой проблемой, вы, вероятно, перепутали настройки при создании нового проекта (как я).

Это краткое изложение комментариев сообщества, ни один из этих ответов не является моим.

1

Вопрос:

Я пытаюсь создать новый проект в visual studio.it дает некоторую ошибку

пожалуйста, дайте мне несколько предложений….. enter image description here

Я этого не знаю.
Я пытаюсь переустановить, и снова появляется такая же ошибка.

Я пробую эту работу…

Ответ №1

Попробуйте 1 первый, если не другой

  • Перейдите в Extentions and updates, затем найдите Nuget и удалите его,
    перезапустите визуальную студию, снова установите Nuget, затем снова перезапустите.
    вы должны иметь возможность создать свой новый проект.
  • Восстановите свою Visual Studio 2013 или 2015

Ответ №2

Я использую Visual Studio 2015 Express Web и имею ту же проблему. Я много искал для решений, и ни одна из них не работала:

  • Переустановите Nuget для Visual Studio 2015
  • Замените Nuget для Visual Studio 2015 с прежним Nuget
  • Запустить Visual Studio как администратор
  • Изменить/Удалить файл IISExpress applicationhost.config
  • Переустановите IISExpress

Единственное, что разрешило это: Repair-install Visual Studio:

  • Нажмите Windows + R
  • Введите appwiz.cpl и нажмите Enter
  • Щелкните правой кнопкой мыши запись “Microsoft Visual Studio Express 2015 для Интернета” и нажмите “Восстановить”
  • Будьте терпеливы…

Примечание.. Это приведет к переустановке всех удаленных вами пакетов, поскольку вам не нужны они (например, собственный клиент Microsoft SQL Server).

Ответ №3

Перейдите по ссылке: VS2013- > Инструменты- > Расширения и обновления- > Онлайн-поиск для NuGet и установка. Исправлена ​​проблема в 2013 году REL

Ответ №4

Я столкнулся с аналогичной проблемой при создании основного проекта .NET в VS 2015, и он разрешил восстановление .NET Core. Возможная причина: ядро ​​.NET было установлено, связанное с версией сообщества VS, но позже я удалю сообщество VS и переустановил профессиональную версию, но .NET Core не был удален с удалением версии сообщества. После восстановления ядра .NET с панели управления он работает сейчас.

Ответ №5

Вам нужно установить менеджер пакетов Nuget из Tools- > Extensions and Updates → online- > и найти “Nuget package manager” из панели поиска и нажать “Установить”.

Ответ №6

Решение Андрея Свирида:

Изменение установки Visual Studio 2015 и снятие флажка Microsoft Web Developer Tools
Удаление папки C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsMicrosoftWeb ToolsDNX, оставленной из предыдущей версии инструментов.
Удаление% LocalAppData%MicrosoftVisualStudio14.0ComponentModelCache
Удаление% LocalAppData%MicrosoftVisualStudio14.0devenv.exe.config
Выполнение ремонта инструментария предварительного просмотра.

Ответ №7

У вас есть соответствующие компоненты, установленные вместе с Visual Studio?

Я получал эту ошибку при попытке добавить новый проект Axure Mobile Services. Зная, как долго восстанавливается Visual Studio, я надеялся избежать этого.

Для меня исправлено открытие программ и функций и выбор “Изменить” Visual Studio, а не “Ремонт”.

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

Ответ №8

Я столкнулся с той же проблемой, когда пытаюсь создать веб-приложение ASP.NET MVC 4 в VS 2012.

Чтобы устранить эту проблему В VS 2012 нажмите “Инструменты” (меню) → “Расширения и обновления” (пункт меню) → в окне “Расширения и обновления” нажмите “Обновить”.

Установите ожидающие обновления для VS 2012, а также для Nuget.

Перезапустите VS 2012.

Ответ №9

У меня была такая же ошибка с использованием сообщества VS 2017 (и предыдущего) при попытке открыть файл .cs или попытке открыть свойства проекта.
Все это на новой установке VS на новой установке Windows 10…

Я нашел 2 решения:

Запустите VS как admin (что не является хорошим выбором и может препятствовать отладке drag & drop в ваше приложение).

или лучше:

Измените параметры безопасности вашей папки% temp% на “все – полный контроль”.:)

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

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

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

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Microsoft visual studio код ошибки 0x80070002
  • Microsoft visual studio возникли ошибки сборки