Static DLL binding in Windows

Consider this situation:

I am creating a DLL (let me call this dllA), which in turn calls functions in other DLLs (let me call these dllX, dllY and dllZ). If someone else wants to use dllA, they will need a copy of dllX, Y and Z.

Is there a way to build dllA so that the necessary functions in dllX, Y, and Z are associated with dllA? I do not know if this is the correct terminology, but is this called a "static DLL link"?

I am looking for a simple solution. I would be pleased with something rude that just combines dllX, Y and Z and adds that to dllA somehow, if such a thing exists. But I have this bad feeling that there is no easy solution.

I am on Windows using VS.

Thanks!

+3
source share
3 answers

You cannot statically link DLLs, but only LIBs. DLLs are autonomous and have static elements and DllMain load / unload dependencies, which means that they cannot be divided into containing functions and linked into another executable file.

You need to create an installer that deploys all the appropriate DLLs as needed.

, , , , DLL (A, X, Y Z) , , dllA dllA. sysinternals x64 x86 64- exes.

+5

, . . DLL, , , , , .

EDIT: .

+1

DLL, ' ' .

  • , __declspec (dllimport) .
  • DLL DLL , DLL, . lib .
  • dll exe.

DLL , exe, .

0

Source: https://habr.com/ru/post/1718771/


All Articles