c++ - VS2013: LNK1104 error when linking with project in same solution -


this 1 of sillier questions on so, can't solve it.

i've got solution containing 3 projects a, b , c. , b static lib projects, , c exe project links , b. i've set build directories build artifacts each project located follows:

a: $(solutiondir)\$(platformname)\$(configuration)\lib\a.lib b: $(solutiondir)\$(platformname)\$(configuration)\lib\b.lib c: $(solutiondir)\$(platformname)\$(configuration)\bin\c.exe 

since exe built in project c expects libs in , b, i've added libraries a.lib , b.lib project c properties->linker->general->additional dependencies. i've added directory locations , b listed above project properties->linker->general->additional libraries directories.

when linking, linker error lnk1104: cannot open file a.lib

can help? i've got experince eof using vs, first time i've built multi-project solution scratch.

many thanks.

when you've added directories listed, mean filename too? because directory part should present, i.e. $(solutiondir)\$(platformname)\$(configuration)\lib.

apart that, need make sure projects being built in correct order. msbuild happily try compile c before (or in parallel with) a , b otherwise. so, either make use of references property page (under project->properties->common properties), or manually force using project dependencies dialog (project->project dependencies...).

i should mention using project references mechanism "new" , recommended way manage dependencies -- it's supposed automatically add outputs of referenced projects input dependencies on referencing project, without having manually specify them. i've not had luck getting part work in past myself, @ least configure dependency chain properly.

for completeness, note .lib file generated if there's symbols contained within compiled project (so, if project empty or otherwise defines no symbols, compiling not produce .lib file, breaking build of dependent projects).


Comments