Question:
Files that need to be included in a C++ based project?
Russel
2010-04-07 21:41:38 UTC
Newbie coder question:

What types of files can/should be included in a C++ based project (in MS Visual Studio, specifically)?

Are .cpp, .h, .dll, and .lib files all you really need?

I've heard of others; ".rc" and icons (.ico) and .dev or something, then of course the project files themselves (.sln, .vcproj)

What is each relevant file type that can be associated with a MS Visual Studio project that is coded in C++, and what does each do? Which ones are necessary and which ones are not? (ie: you don't need icon files necessarily, and I've never used rc files so I guess you don't "need" them either)

Also, what kind of projects / files can be built? exe's, lib's, and dll's? Anything else? Can building one single project create multiple DLLs or EXEs or LIBs?

Thanks everyone!
Three answers:
michael_white2
2010-04-08 02:12:39 UTC
You HAVE to have at least one .cpp file. This is where you put your code.



.h Files are good for when you are creating Classes. You usually put a class' definition in a .h (or .hpp).



.dll files are 'Dynamic Link Library' files. .lib Files are similar.



.rc are 'Resource' files. This tells your compiler what resources to include into your project.



.dev, .sln, are files that are generated by your compiler. So, yes, they're required, and if you delete them you have to start over by rebuilding the project and letting the compiler remake the files.



You can only have ONE .exe file. That is the accumulation of the entire project and how you would start by double-clicking it.



You could program multiple .dll files...if you coded it that way. But probably a good idea to make it only one so that your program is not confusing to someone.
griglik
2016-10-15 08:41:26 UTC
decide for for computerisation: it is unquestionably a large study subject rely. it is unquestionably for errors unfastened and workflow-pushed systematic technique. advancements: friendly click-n-p.c.. GUI.
Rai
2010-04-07 21:42:39 UTC
You got a C+ for that? Your teacher must be retarded. XD


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...