0

I have a Visual Studio 2019 DLL project, and I want to link a library statically against it. When I use symbols from the static library in the dll, it builds correctly. However, when I link my dynamic library project to an executable application, the application gives an unresolved external symbol error. Do I have to link the static library against the application as well?

Uytab
  • 85
  • 1
  • 7
  • Does this answer your question? [Statically linking a DLL in Windows](https://stackoverflow.com/questions/1490685/statically-linking-a-dll-in-windows) – Pat. ANDRIA Apr 23 '21 at 07:49

1 Answers1

0

A DLL is a binary, similar to an EXE file, so when you link it against your static library, all dependencies have to be satisfied. An EXE file linking against this dynamic library doesn't know about any of it's internals like the symbols of some static library, and consequently there should not be any unresolved symbols because of the static library.

The only way you can get this, is if you link the EXE also against the static library and use some symbols from it, but this independent of the DLL.

So no, unless you are using something from the static library in your EXE file, then you don't need to link against it.

Devolus
  • 21,661
  • 13
  • 66
  • 113