0

I have two visual c++ projects in my solution. First one (lets call it Main) is native code. The second one (Test), has Main added as reference. Test contains unit tests to methods in Main.

When I add Main as a reference to Test and try to compile it - I get errors that the library could not be found. Does adding a project as reference , does not add the output target path of Main to the library directories of Test ?

Captain Jack sparrow
  • 959
  • 1
  • 13
  • 28
  • No, it adds the .lib file that the project generates as a link dependency. Seems your project doesn't generate a .lib file. Perhaps because it is not a static library project or is a DLL project that forgot to export anything. Always best to avoid us having to guess, type more. – Hans Passant Nov 08 '16 at 11:05
  • It is a dll project but when I look at the release directories, I can see .lib. – Captain Jack sparrow Nov 08 '16 at 18:10

1 Answers1

0

I don't know what VC is exactly doing under the hood, but adding reference to a project doesn't seem to have effect of linking libraries unlike C#.

You can use the code from another project by including and linking via the usual method of c++.

Community
  • 1
  • 1
Doncot
  • 78
  • 2
  • 6