8

I am converting some Qt project files (.pro) that run on Linux and Mac into Visual Studio project files (.vcproj) The Qt Visual Studio add-in converted everything fine except the DLL dependencies. Where do I put these in Visual Studio 2008?

If I put the DLLs in Configuration Properties > Linker > Input > Additional Dependencies, I get:

fatal error LNK1107: invalid or corrupt file: cannot read at 0xABC

Where do dynamically-linked dependencies go?

SolarBear
  • 4,534
  • 4
  • 37
  • 53
Dave Mateer
  • 17,608
  • 15
  • 96
  • 149
  • 1
    It should be noted that there is also something which is called "Import Library" check http://stackoverflow.com/questions/3573475/how-does-the-import-library-work-details – Wakan Tanka Sep 08 '16 at 22:51

2 Answers2

11

Project Properties -> Linker -> Input -> Additional Dependencies

In that field put xxxx.lib for whatever library you need.

Ben Burnett
  • 1,554
  • 10
  • 17
10

You might want to check what’s the differences between .dll , .lib, .h files ?.

You need to specify the corresponding .lib file at link time. not the dll.

Community
  • 1
  • 1
Troubadour
  • 13,334
  • 2
  • 38
  • 57
  • 5
    As a novice Visual Studio and MS Windows developer, I found this answer a bit confusing. To clarify my confusion I needed this detail: indeed, to dynamically link a library (dll) the linker needs a lib file (lib). The dll and lib file are related and the lib file tells the linker something about the dll. This is _not_ the way things work on Unix OSes, and I found it confusing. In some cases (static linking) the lib file has the compiled code, but in the case of dlls, it does not. – Jason Feb 25 '17 at 17:58