I have a VC++ 2010 solution with multiple project, one of which is a .lib produced by my desire to put some common code in a single place.
I’m now trying to get another of the projects, which is a normal console application, to link to this library. However, VS is complaining that it can’t find the .lib even though I added it as an additional dependency.
I was kind of hoping that VS would make it easy on me since the .lib is in the same solution, albeit in a different project, but sadly, no luck.
EDIT I must be blind but I can’t seem to find the ‘additional paths’ option Tim mentioned. I added the lib project to the project dependencies of the console project, but it still isn’t working.
EDIT2 Edwin’s suggestion did the trick after I actually added the .cpp and .h files to the .lib project. I really hate it when I miss something so obvious.
In the properties_>Common Properties->Framework & dependecies of your executable you can add projects on which your executable is dependant of. After that you only need to adjust additional include paths of C++->General to let it find your include-file.
EDIT: I have an exe-project named AppTest and a lib-project Dummy.
I added the project Dummy to Framework & dependecies of AppTest.
Then i adjusted for all configurations the include paths of AppTest to point to directory of Dummy.
Then i included dummy.h in apptest.cpp and a call to a function from dummy.lib.
Build the solution. That’s all.