Project organizing in Visual Studio
I'm going to cut my project into few parts in one solution. The main part will be console-window and another one should be static-lib. The problem is linking dependencies into static-lib projects. For example, I have a scheme below:
Project lib 1 -> TinyXml /
Main proje开发者_Go百科ct
\ Project lib 2 -> Another lib
As you can see, my first lib should use TinyXml. Before this I linked tinyxml-lib and included a few .h files. But in lib-project I can't link another lib. So, what should I do? Or I just can link all dependencies into main project?
Instead of the 'Linker' option in the configuration pages, you have the 'Librarian' option when building static libraries. There you can enter 'Additional Dependencies' just as you would for an executable.
When you setting reference for 'TinyXml' in 'Project lib 1', VS makes everything needed for 'TinyXml' output be copied with 'Project lib 1' to output of 'Main project'.
So you need just to make project components independent - 'Main project' should know only about it's direct references, i.e. 'lib 1' and 'lib 2', and libs will know only of it's direct references.
精彩评论