Shared Object Files
I have two projects within one solution. Both projects contain some files开发者_C百科 that are the same. For instance, Project1 contains shared.cpp and so does Project2. However, when I edit shared.cpp and build both projects, is there any way I can make VC++ compile the source file once, then use the single object file in the linking of the two projects, rather than compiling it twice? The obvious purpose being to decrease build time.
Put shared.cpp in a separate project in the same solution and make it build as a library. Then add that project as a dependency to project1 and project2.
精彩评论