在VS哪种新项目主要功能有参数? [英] In VS which kind of new project the main function has parameters?

查看:87
本文介绍了在VS哪种新项目主要功能有参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在VS中新建一个项目时,主要功能有哪些新项目参数,请输入int main(argc int,** argv char)。

此外,新的VS项目CPP文件似乎自动添加#includestdafx.h,删除这将导致错误;但是很多开源项目的cpp文件都不包含#includestdafx.h,它还通过VS编译器,为什么呢?谢谢!!!

在项目中,properties-> general-> Target Name是aaaaa,properties-> general-> Target Extension是.exe,但链接器 - >高级 - >导入库是aaaaa.lib,为什么exe项目可以创建.lib文件?



什么我试过了:



我尝试过很多种项目

When I new a project in VS, which kind of new project the main function has parameters, sucn as "int main (argc int, **argv char)".
In addition, the new VS project CPP files seems Automatically add "#include "stdafx.h"",delete this will lead to an error; But a lot of open source projects the cpp files do not contains the"#include "stdafx.h"", which also pass through the VS compiler, why? thank you!!!
In a project, "properties-〉general->Target Name" is "aaaaa", "properties-〉general->Target Extension" is ".exe",but "Linker-〉Advanced->Import Library" is "aaaaa.lib", why a exe project can creat a .lib file?

What I have tried:

I have tried many kind of projects

推荐答案

很多开放源项目针对其他操作系统。头文件stdafx.h对于Visual Studio和MFC是特定且独特的,主要针对Windows,尽管OSX已经或即将发布。



properties->一般表单页面有一个目标类型参数。它应设置为executable或.exe。
Many open source projects target other operating systems. The header file stdafx.h is specific and unique to visual studio and MFC which are primarily targeted at windows although an OSX has or is about to be released.

In the properties->general form page there is a target type parameter. It should be set to executable or .exe.


在创建项目时,在应用程序设置中,您可以删除任何其他项目stuff:删除它(例如预编译头),然后选择空项目

然后,您可以添加任何您想要的标题或源文件。你至少要添加一个源文件(比如 main.cpp )并输入你喜欢的任何程序。一个简单的例子:

While creating the project, in application settings, you may get rid of any additional stuff: remove it (for instance precompiled headers) and then select empty project.
Then you may add any header or source file you wish. You have, at least, to add a source file (say main.cpp) and type into it any program you like. A simple example:
#include <iostream>
int main( int argc, char * argv[])
{
	std::cout << "not very useful, after all" << std::endl;
}</iostream>


这篇关于在VS哪种新项目主要功能有参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆