1

I have bass.lib, bass_fx.lib and zlib.lib in my Library folders and Additional Dependencies in my project. enter image description here

enter image description here But when I run my program, it complains it can't find bass.dll, bass_fx.dll and zlib.dll.

How can this be fixed?

Raildex
  • 3,406
  • 1
  • 18
  • 42
  • 1
    Similar: https://stackoverflow.com/questions/2240737/static-linking-to-lib-and-still-requesting-dll – D-RAJ Jan 03 '21 at 09:09
  • 1
    @DhirajWishal How do I know whether a .lib file is a export table or an actual library? Just the file size? – Raildex Jan 03 '21 at 09:14
  • I,m not that familiar with this topic but these links might help: [MSDN](https://learn.microsoft.com/en-us/cpp/build/reference/dumpbin-reference?view=msvc-160&viewFallbackFrom=vs-2019), [SO](https://stackoverflow.com/questions/305287/how-to-see-the-contents-of-windows-library-lib) – D-RAJ Jan 03 '21 at 09:16
  • 1
    @Raildex See [know if .lib is static or import](https://stackoverflow.com/questions/6402586/know-if-lib-is-static-or-import). – dxiv Jan 03 '21 at 09:17

1 Answers1

2

If you want to link statically, first you have to make sure that the *.lib's you have are really static and not dynamic libraries (which seems to be the case).

You can use dumpbin from visual studio command line tools, to verify what's inside those .libs.

StPiere
  • 4,113
  • 15
  • 24
  • I know how DLL linking works, but I want to link the specific libraries statically. – Raildex Jan 03 '21 at 09:11
  • 1
    I think what OP is trying to ask is that he s trying to link it statically but the application is requesting a .dll file. – D-RAJ Jan 03 '21 at 09:12
  • 2
    If you exe complains it cannot find dll's - in that case you're not linking statically – StPiere Jan 03 '21 at 09:12