-1

It seems that no matter what I do, I can't get the Additional Dependencies to properly link my static library.

This static library is created from another project I made. I've tried adding it as a reference, forcing project dependencies, double checking that the path to the lib is correct. The only thing that seems to make my unresolved external linker errors disappear is a #pragma comment (lib, XX).

Does anyone know why this is? I'd very much like to avoid the #pragma comment and just have it added as an additional dependency.

Thanks!

pantaryl
  • 155
  • 1
  • 10
  • Can you give more details... Are you setting the path to the libraries correctly? – Samer Jun 20 '14 at 02:14
  • In Configuration Properties -> VC++ Directories -> Library Directories, I have properly set the relative path of where the built .lib file resides. – pantaryl Jun 20 '14 at 02:15
  • 1
    Are you using debug or release? Are you sure you are separating the lib by `;` – Samer Jun 20 '14 at 02:16
  • This is dbg, 32 bit. I am building an executable which links to a static library. The library is similarly built dbg, 32 bit. The libraries are separated by a ;. – pantaryl Jun 20 '14 at 02:18
  • My guess is your relative path is wrong. – drescherjm Jun 20 '14 at 02:25
  • I have another executable project which is at the same level as my executable project which is linking to a different static library which is at the same level as my static library project. This other project works without a project. They are both building to the same place. – pantaryl Jun 20 '14 at 02:27
  • 2
    'VC++ Directories ' is the wrong place to go. You probably need 'configuration properties/linker/general/additional library directories'. – Ofek Shilon Jun 23 '14 at 18:40

1 Answers1

0

One more thing: make sure that the project which make the lib got built first, i.e. make sure that the libraries are already created before linking your project.

Samer
  • 1,923
  • 3
  • 34
  • 54