11

I have generated a .lib file from another project that I would like to use in my project. I have added the file to LinkerInputAdditional dependencies as bluetoothserialport.lib.

I've added the lib file inside my project at this level: http://i65.tinypic.com/1t9fki.jpg

However I get the following error:

1>LINK : fatal error LNK1104: cannot open file 'bluetoothserialport.lib'

I am using Windows 10 and C++.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
john g
  • 111
  • 1
  • 1
  • 5
  • Try adding the path to the library in Additional Library Directories. – Michael P Apr 22 '16 at 05:47
  • 1
    You'd think this question would have a better answer by now. Or at least the top answer would be upvoted more so we could know if it is correct – Dan Feb 27 '17 at 21:56

1 Answers1

4

If you come from an Xcode background you might expect a reasonable IDE to know what all the things in a project are. Visual Studio is not such an IDE.

You need to, explicitly, go to the LinkerGeneralAdditional Library Directories, and add a path to your .lib there.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Chris Becke
  • 34,244
  • 12
  • 79
  • 148
  • I'm also an Xcode user and find myself in the same situation as the op, but to be fair: there are also settings to be made in Xcode. And if you've ever compiled a dylib, you will know that this is also not very straight forward. – guitarflow Dec 19 '16 at 17:53