Reputation: 53
I'm having issues building a PostgreSQL client on Windows. Actually, it compiles fine and runs smooth on the compiler machine (the one who has compiled the application), but on different computers (that don't have the postgresql server) it gives me errors - it can't find *.dll. I fixed this by adding .dlls manually to the folder of the application (I don't think this is a good way to deal with this and it works only for 32-bits machines).
Can you tell me which libraries should I link or how can I handle this situation?
Thank you!
Upvotes: 0
Views: 805
Reputation: 324541
You're most likely using libpq.dll
, the main PostgreSQL client library. You can determine which libraries it requires using Dependency Walker, but from memory it just needs the openssl DLLs that're in the same directory as it in the PostgreSQL bin dir, and maybe zlib. I don't have a handy Windows box to check with right now. libpq
and its direct dependencies from the PostgreSQL bin
folder should just be bundled with your application in the same directory as your application executable. They won't be used by anything except your app and won't cause conflicts with software installed elsewhere on the system.
There's one additional dependency I suspect may be biting you: You need the appropriate version of the Microsoft Visual Studio C++ Redistributable installed on the target machines. This is installed automatically by the PostgreSQL installer. If you're bundling libpq in an application your installer must run the redist installer as well. The required version depends on exactly which PostgreSQL version you're using (which you neglected to mention); it can be determined with dependency walker.
Upvotes: 1