简体   繁体   English

我已经安装了Visual Studio 2015,但是没有C ++项目。

[英]i have installed the Visual Studio 2015, but there is no C++ Project.?

I am facing problem, I want to write c++ code in visual studio 2015, but I can't create c++ project because there is no c++ template in the New Project window. 我面临问题,我想在visual studio 2015中编写c ++代码,但我无法创建c ++项目,因为New Project窗口中没有c ++模板。

I am creating new project in this way File > New > Project > Visual C++ 我正在以这种方式创建新项目File> New> Project> Visual C ++

but there is no c++ template. 但是没有c ++模板。 Please help 请帮忙

The VS2015 installer does not install C++ by default. VS2015安装程序默认不安装C ++。

Since you already have Visual Studio installed, you can modify the existing install. 由于您已安装Visual Studio,因此可以修改现有安装。

  1. On Control Panel->Programs and Features (or run appwiz.cpl) find and run the Installer for Visual Studio 2015. 在控制面板 - >程序和功能(或运行appwiz.cpl)上查找并运行Visual Studio 2015安装程序。
  2. Wait for Installer dialog to load. 等待加载安装程序对话框。
  3. Click the Modify button on the bottom of the installer dialog. 单击安装程序对话框底部的“修改”按钮。
  4. On the Features Tab, expand Programming Languages. 在“功能”选项卡上,展开“编程语言”。
  5. Select Visual C++. 选择Visual C ++。
  6. Click the UPDATE button on the bottom right. 单击右下角的“更新”按钮。

That should do it. 应该这样做。 You may have to insert the install media or suffer through a download, but these days Windows caches the installer info so everything needed may already be present on your system. 您可能必须插入安装媒体或遭受下载,但最近Windows缓存安装程序信息,因此您的系统上可能已经存在所需的一切。

转到online菜单(它位于Recent and Installed下面。您可以下载C ++模板和示例。请参阅此MSDN文章,其中详细介绍了它。

While most users will be unblocked by the accepted solution, there is another scenario where Visual C++ is not working as intended for VS2015. 虽然大多数用户将被已接受的解决方案解除阻止,但还有另一种情况是Visual C ++无法正常运行VS2015。

I was installing both VS2015 and VS2017 on the same system on the same day. 我在同一天在同一系统上安装了VS2015和VS2017。 Long story short, I got this person's problem . 长话短说,我得到了这个人的问题

From the link: 从链接:

I am also running into this -- but in my case, I also installed full VS2015 Pro. 我也遇到了这个 - 但就我而言,我还安装了完整的VS2015 Pro。 It shows that the VC++ common tools are installed, but they are not on disk in the usual location, they seem to be in the MSVS/Shared folder (Program Files (x86)/Microsoft Visual Studio/Shared/14.0/VC/bin/cl.exe reports version 19.00.124218.2). 它显示VC ++常用工具已安装,但它们通常位于磁盘上,它们似乎位于MSVS / Shared文件夹中(Program Files(x86)/ Microsoft Visual Studio / Shared / 14.0 / VC / bin / cl.exe报告版本19.00.124218.2)。 Uninstalling VS2015 removes these, and reinstalling puts them back in Shared. 卸载VS2015将删除这些,并重新安装将它们放回Shared。

For me at least, it goes worse than just the batch files -- I can't actually create any C++ projects. 至少对我来说,它比批处理文件更糟糕 - 我实际上无法创建任何C ++项目。 Trying to create one just causes the "New Project" window to pop up again; 尝试创建一个只会导致“新建项目”窗口再次弹出; no error, no warning. 没有错误,没有警告。


No amount of uninstalling components from both 2015 or 2017 got me into a usable state (Shared\\14.0\\VC still persisted as the install dir, I couldn't find what component was keeping those tools on-disk and preventing them from being removed). 2015年或2017年没有任何卸载组件使我进入可用状态(Shared \\ 14.0 \\ VC仍然作为安装目录保留,我找不到哪些组件将这些工具保留在磁盘上并阻止它们被删除) 。 I ended up just copying the contents of "Microsoft Visual Studio/Shared/14.0" into the "Microsoft Visual Studio 14.0" folder -- a gross hammer, and VS2015 still can't create C++ projects, but it got me unstuck, and existing build systems started finding tools again. 我最后只是将“Microsoft Visual Studio / Shared / 14.0”的内容复制到“Microsoft Visual Studio 14.0”文件夹中 - 这是一个粗略的锤子,VS2015仍然无法创建C ++项目,但它让我解开了,现有的构建系统再次开始寻找工具。

VS team -- I totally get the goals of the layout change, and I love what you guys are doing with VS overall. VS团队 - 我完全了解了布局变化的目标,我喜欢你们VS整体做的事情。 But please treat this as a major bug; 但请将此视为一个主要错误; you can't decide to permanently change the location of build tools that have been in one place for multiple years, as it will break many, many existing build systems. 您无法决定永久更改多年来在一个地方的构建工具的位置,因为它会破坏许多现有的构建系统。 At best, install them in both locations; 充其量,将它们安装在两个位置; let VS2015 manage the "Visual Studio 14.0/VC" dir like it always has, and let VS2017 manage the Shared/14.0 dir (via the "VS2015 C++ build tools" package). 让VS2015像往常一样管理“Visual Studio 14.0 / VC”目录,让VS2017管理Shared / 14.0目录(通过“VS2015 C ++构建工具”包)。 They should be unrelated. 他们应该是无关的。


Fix: 固定:

  1. Uninstall all copies of Visual Studio 卸载Visual Studio的所有副本
  2. If you have frameworks that can install copies or partial copies of Visual Studio, or rely on them, consider uninstalling them too. 如果您的框架可以安装Visual Studio的副本或部分副本,或者依赖它们,请考虑卸载它们。 For me, this was a couple versions of Qt. 对我来说,这是几个版本的Qt。
  3. Nuke C:\\Windows\\Temp and %temp% Nuke C:\\Windows\\Temp%temp%
  4. Nuke anything visual studio related in C:\\PROGRA~1,2,3, %appdata%, and %localappdata% 在C:\\ PROGRA~1,2,3,%appdata%和%localappdata%中修改任何相关的视觉工作室
  5. Reboot 重启
  6. Install the oldest version of Visual Studio you want to use first 首先安装要使用的最旧版本的Visual Studio
  7. Try to build a C++ Win32 console app with that version 尝试使用该版本构建C ++ Win32控制台应用程序

If you can do that, you're unblocked. 如果你能做到这一点,你就会被解锁。 Otherwise, yikes! 否则,哎呀! I don't know what to do next short of a full registry deep-dive keyword purge or a re-install of Windows. 我不知道接下来要做什么,而不是完整的注册表深度关键字清除或重新安装Windows。 With an SSD, the latter is probably faster TBH. 使用SSD,后者可能更快TBH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2015中没有C ++项目属性 - No C++ Project Properties in Visual Studio 2015 在Visual Studio 2017上创建新的C ++项目时,我没有更改默认位置的选项,因为2015 - On Visual Studio 2017 while creating a new C++ project I don't have the options to change the default location as 2015 had 如何使Visual Studio 2015 C ++项目与Visual Studio 2010兼容? - How do I make a Visual Studio 2015 C++ project compatible with Visual Studio 2010? 如何从 Visual Studio 2015 C++ 项目导出 Makefile - How to export a Makefile from a Visual Studio 2015 C++ project 如何在 Visual Studio 2015 中使用 mongoose 构建 C++ 项目 - How to build a C++ project using mongoose in Visual Studio 2015 将具有子文件夹层次结构的文件夹添加到Visual Studio C ++ 2015项目 - Add folder with subfolders hierarchy to visual studio c++ 2015 project 在Visual Studio 2015中将SQL连接到C ++项目 - Connect an SQL to c++ project in visual studio 2015 visual Studio 2015 c ++将独立的dll文件添加到项目 - visual studio 2015 c++ add a standalone dll file to a project 加载Visual Studio 2015 C ++项目时出错,如何调试 - Error loading visual studio 2015 C++ project, how to debug 如何在Visual Studio 2015中成功导出C ++项目模板? - How to successfully export C++ project template in Visual Studio 2015?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM