0

I am trying to configure a Debug configuration for projects in a Visual Studio solution I inherited. The solution compiles fine in Release. In debug I get a bunch of LNK2019 unresolved external symbol "__declspec(dllimport) ... The different projects to be compiled into DLLs that are linked to the other projects.

I am reasonably confident that this NOT a problem with my "Additional Library Directories" or "Additional Dependencies" as I have checked this and Release and Debug match...

I have also noticed that if I add __declspec(dllimport) to (some) of the functions that fail to link, the corresponding error disappears.

So my question is: What option on my debug configuration could be causing linking errors that only occur if I do NOT put __declspec(dllimport) in the routines being linked?

jmlorenzi
  • 163
  • 5
  • I think you are missing an import library for the debug configuration. Note that the debug import library (and dll) probably not be the same as the one for release unless the dll is pure `c` code. – drescherjm Jul 16 '19 at 15:10
  • `__declspec(dllimport)` is optional. Clearly, you're missing something. Could you create a [\[SO\]: How to create a Minimal, Reproducible Example (reprex (mcve))](https://stackoverflow.com/help/mcve)? – CristiFati Aug 14 '19 at 09:38

0 Answers0