0

I specified Linker->General->Output File for my target .dll file. I wanted the corresponding .pdb and import .lib to be created in the same folder, but they weren't. How can I achieve that?

========================================================================= I've just found that. In Project Property->Linker->Debugging, pdb file can be set, and in Project Property->Linker->Advanced, import library can.

However, because I changed the location for the import library, building another project in the same solution would get an error saying it cannot open that import library. So now I need to find out how to specify the location of an import library which is needed as an input.

xiaokaoy
  • 1,608
  • 3
  • 15
  • 27

1 Answers1

1

For the 1st project (let's call it producer), you changed the import library (producer.lib) path from (for simplicity's sake, let's say):

  • C:\old_path

to:

  • C:\new_path

So far so good, producer project builds, and producer.lib is placed in C:\new_path.

But there's another project (let's call it consumer) that looks for producer.lib in C:\old_path. Obviously, the .lib is not there and consumer build fails. To fix that, you have to update the paths where consumer is looking for libs, and change them as you did for producer.
In order to do that, go in consumer's properties under Linker -> General -> Additional Library directories and replace C:\old_path by C:\new_path.

Here's [MS.Docs]: /LIBPATH (Additional Libpath) for future reference.

You could also check [SO]: How to include OpenSSL in Visual Studio (@CristiFati's answer) for more details on this topic.

Note that other projects in the solution could be in the same situation.

CristiFati
  • 38,250
  • 9
  • 50
  • 87