Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 2-Dec-16 6:46am
v2

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.
 
Share this answer
 
Comments
motata2motata 4-Dec-16 11:38am    
In a project, can a .exe file and .lib file with the same name be created simultaneous?
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:
C++
#include <iostream>
int main( int argc, char * argv[])
{
	std::cout << "not very useful, after all" << std::endl;
}</iostream>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900