简体   繁体   English

Microsoft Visual C ++无法编译

[英]Microsoft Visual C++ Not Compiling

I have Microsoft Visual Studio 2010 for C++. 我有C ++的Microsoft Visual Studio 2010。 I can compile files that are created when the project is created. 我可以编译在创建项目时创建的文件。 However, when I do File > New > New File, I can't compile the new file. 但是,当我执行“文件”>“新建”>“新文件”时,无法编译新文件。 There is no option. 没有选择。 Am I doing anything wrong? 我做错什么了吗?

Thanks 谢谢

You need to add the file to your project before you can compile it. 您需要先将文件添加到项目中,然后才能对其进行编译。 Right click on the project and select "Add" from the context menu then "Existing Item" for files you have already created and "New Item" to create new files and automatically add them to your project. 右键单击该项目,然后从上下文菜单中选择“添加”,然后为已创建的文件选择“现有项”,然后单击“新建项”以创建新文件并将其自动添加到您的项目中。

Alternatively you can open the "Project" menu and select either "Add New Item" or "Add Existing Item". 或者,您可以打开“项目”菜单,然后选择“添加新项”或“添加现有项”。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM