Scenario 1, under solution SolA there's only 1 project named PrjA. PrjA is a Win32 console application, the compilation result is PrjA.exe.
How shall I split PrjA int PrjA1 and PrjB, so that the management of the source code is easier, however, the compilation result, PrjA1.exe, will be almost the same as PrjA.exe?
What I want to split is the source code files, but I hope the compilation result, the exe file remains almost the same after the code split.
For example, PrjA originally has 300 .cpp source code files, compiled to PrjA.exe sized 400KB. I hope to split PrjA into 2 projects: PrjA1, containing 200 .cpp files, and PrjB, containing 100 .cpp files. But after compilation, I hope PrjA1.exe is also around 400KB.
I'm not sure how to set PrjB, what will be its compilation result. Assume PrjB compiles to PrjB.DLL, sized 100KB, I hope PrjA1.exe will somehow embed PrjB.dll inside, sized 400KB. I don't want a 300KB PrjA1.exe, which will dynamically link to 100KB PrjB.dll in runtime.
So question for scenario 1, the question is, how shall I set PrjB, and how shall I set the link between PrjA1 and PrjB?
Scenario 2, same as Scenario 1, just this round PrjA's compilation result is a windows DLL, named PrjA.dll, how shall I split PrjA into PrjA1 and PrjB?
The development environment is Visual Studio 2013 under windows 7 64-bits, but the compilation results are 32-bit.
First thing to do is to add new project to the solution.
File -> Add -> New project -> Win32 Project
That's it. Now when you build your solution, VS builds your static library, builds your main project and links them together. The result should be identical as if everything is in the same project.