1
0
I have installed Visual Studio 2015
on my Windows 10
PC in order to create a C++
simple program.
Even if I try to run a basic Hello World
program like this:
#include <iostream>
int main() {
std::cout << "Hello world";
return 0;
}
And click the Local Windows Debugger
button to run the code VS2015 freezes and I have to kill it form task manager.
The worst part is that sometimes it leaves C++
program running and it can not be killed (not even with taskkill /f /pid
and I have to reboot the PC
so that I can try to build again without getting a program.exe
is in use error.
So, VS
installation is new and I also had to install the Win32 (C++)
support which no longer installs by default.
Any suggestions on what might be wrong or how could this be fixed?
Thank you!
What did you install exactly? Your statement that you had to "install" Win32 support on your Windows 10 because it wasn't installed by default isn't correct. Windows has to support Win32 applications by default for a variety of reasons. – Ramhound – 2015-11-18T12:29:36.140
@Ramhound http://blogs.msdn.com/b/vcblog/archive/2015/07/24/setup-changes-in-visual-studio-2015-affecting-c-developers.aspx
– Cristy – 2015-11-18T17:27:54.7301So out of those 4 plus different packages what did you install precisely? Update your question to include this information. Use specific feature names. What toolset are you using precisely? – Ramhound – 2015-11-18T17:33:50.277
Common Tools for Visual C++ 2015. Also installed MFC after, but still the same result. Whenever I try to run a hello world program the whole IDE just freezes (it says Build started in the log, then I think it tries to run the executable and says Build successful in the status bar). – Cristy – 2015-11-18T18:27:46.327
1Suggestions: (1) Fully patch your installation of VS2015 via VS itself and Windows Update (attention to optional updates). (2) Disable your antivirus (if this helps then get another one). (3) Try to rename the folder
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache
and start VS. At startup, VS will rebuild the cache. – harrymc – 2015-11-21T09:38:52.613@harrymc Tried that, it fixed other problem I had (with a C# project not starting) but C++ hello world still doesn't want to start, freezes VS after build. – Cristy – 2015-11-22T20:44:31.417
You mean that C# programs now work but not C++? Have you tried other C++ programs (i.e. is it a general C++ problem) ? Try starting devenv with /SafeMode parameter to see if this is an add-on problem.
– harrymc – 2015-11-22T21:29:55.610C# always worked. It just happened today for a C# project (after I pulled some changes) to no longer work. Deleting the
ComponentModelCache
mentioned above helped fix this issue, but did not affect in any way the C++ problem. I tried creating other C++ project and it shows this:Severity Code Description Project File Line Error LNK2019 unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
– Cristy – 2015-11-22T21:37:02.0331
This is a normal problem with your project, not with VS: You're compiling a Windows exe, not a console exe, so you're expected to either provide a WinMain function containing an event loop, or to convert the project to Console. See this thread for more info. If you confirm that the problem is solved, I will post this as an answer.
– harrymc – 2015-11-23T06:45:31.727