Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
I have VC projects in my VS 2008 solution say (A, B). Both are currently win32 application of type static library.
Project B is dependent on A.lib, which is generated in $(solutionDir)\Debug directory. I have specified "$(solutionDir)\Debug" as additional library directories in project B's properties. But it still gives me error
LINK : fatal error LNK1181: cannot open input file A.lib.

Further if I provide the Absolute path of the debug directory the build process runs fine.

please help me solve this situation without using an Absolute path.


Thanks for the quick reply. I have already set the dependencies, further the macros and files were spelled correctly with proper case.
Posted
Updated 26-Feb-11 4:24am
v2

Try putting the .lib in $(SolutionDir) instead. Then you won't need the "additional libraries" addition.

-PaulH
 
Share this answer
 
1. It seems rather trivial, but make sure project A is compiled and archived before project B is archived.
You can do this by setting project dependencies by right clicking any of the projects A and selecting Project Dependincies.

2. Not sure if environment variables in VS are case sensitive, but it is usually spelt
$(SolutionDir)


3. Make sure that A.lib exists in the specified folder, and you have spelt its name correctly.
 
Share this answer
 
I use "..\..\myproject\debug\A.lib" (of course use your own relative path) defined as "Additional Dependencies" in the Project->Properties->Linker->Input options to do this very same thing in VS2008. Works well for me.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900