does every .exe file need a new project in Microsoft Visual C++?
My background is Linux and traditional makefiles. I have a project where the makefile builds several dozen executables I can then run to perform tests against the librar开发者_StackOverflowy being developed. This library is now ported to Windows.
My question: In Microsoft Visual C++, do I have to create a new project for every individual test .exe
file? Or is there a way to create 1 project that will easily build all of the .exe files? E.g., test001.cpp
becomes test001.exe
, test002.cpp
becomes test002.exe
, etc.
I'm using Microsoft Visual C++ 2010 Express. Right now what I do is click on File->Add->New Project...->Win32 Console Application->...
for every test executable. But it would be nicer if all these test files could be built without a new project for each one.
You need to have one project per executable, but you can have multiple projects per Visual Studio "solution".
When you build a solution, all of its projects get built. If you need the projects to be built in a specific order within the solution, you can easily set up dependencies.
If you're using Visual Studio in the normal fashion, then yes, each VS project (i.e. each .vcproj
file) corresponds to exactly one output file (an executable, DLL, or static library).
You can also use Visual Studio with makefiles though, if you want. Just write your makefile as usual, except the C++ compiler is the cl.exe
in the VS binaries directory, the linker is link.exe
, and of course all of the command line flags are completely different. You can even set your VS project to use make
instead of its built-in system, so you can still use the IDE for editing and debugging.
精彩评论