B
B
beduin012014-12-24 10:35:09
DLL
beduin01, 2014-12-24 10:35:09

How to change the path where the application looks for the dll?

There is an application that uses the libpq.dll library. The application compiles normally, but at startup it requires the libintl.dll library (as I understand it, libpq.dll is tied to it). The application looks for it in the current folder, and if this library does not exist, it crashes.
I want to move all libraries to the /libs folder question. How can I make libpq.dll look for the libintl.dll library not in the current application folder, but in the /libs folder?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
William Thorn, 2014-12-24
@xydope

Try to register the library in the system using regsvr32
support.microsoft.com/kb/249873/ru

A
Armenian Radio, 2014-12-24
@gbg

You either need to add the path to the libs folder to PATH.
Or add the library path to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs key.
MSDN

M
maaGames, 2014-12-24
@maaGames

Use lazy loading of the library and, first of all, add the path to your folder in the search paths. This must be done before calling any of the dlls. The approach is similar to using LoadLibrary, only you don't need to load the library or export the functions.
Directly in the first line in main (or where you have an entry point) call ::SetDllDirectory( path to the folder with dll )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question