Page 1 of 1

How to use external dll?

Posted: Fri May 19, 2023 4:01 am
by Rathinagiri
Hi friends,

I want to know how to use the dll files instead of using static libraries.

Let me tell my use case.

I have the latest sqlite3.dll file. Instead of using the libsqlite3.a, how to use the external sqlite3.dll file? I am not bothered to send my application along with this dll file.

Re: How to use external dll?

Posted: Fri May 19, 2023 3:38 pm
by gfilatov
Rathinagiri wrote: Fri May 19, 2023 4:01 am Hi friends,

I want to know how to use the dll files instead of using static libraries.
...
how to use the external sqlite3.dll file?
Hi Rathinagiri,

Please take a look at the attached Sqlite example for HMG 3.6 (64-bit). :arrow:
The archive contains the necessary sources, dll and make files along with a working executable file.
Note that you must copy the libsqlite3.a library file to your \hmg.3.6\harbour64\lib\win\mingw64\ folder
as a first step to correctly compile this example. :idea:

Re: How to use external dll?

Posted: Fri May 19, 2023 4:52 pm
by Rathinagiri
Thank you very much for the sample Grigory. This is how I use it as of now for all my applications.

What I am asking is exactly opposite of this. ie., is there anyway to avoid libsqlite3.a and use the dll file instead? Like libmysql.dll

Re: How to use external dll?

Posted: Fri May 19, 2023 6:26 pm
by gfilatov
Rathinagiri wrote: Fri May 19, 2023 4:52 pm This is how I use it as of now for all my applications.

What I am asking is exactly opposite of this. ie., is there anyway to avoid libsqlite3.a and use the dll file instead? Like libmysql.dll
Dear Rathi,

I seem to have expressed myself unclearly. :(

The provided library libsqlite3.a is similar to libmysql.dll. It was compiled using a batch file def2lib.bat.

Just try to run the application without sqlite3.dll in the same folder. :arrow:
And you will see a missing DLL error message.

Re: How to use external dll?

Posted: Sat May 20, 2023 2:11 am
by Rathinagiri
Wow! You are so great Grigory! Thanks a lot!

Re: How to use external dll?

Posted: Sat May 20, 2023 3:48 am
by Rathinagiri
Thanks to Grigory's guidance, now, we can use SQLCipher latest version (3.4.2) to safely encrypt our entire database!

Attached is the required .dll and .a files for latest HMG 64bit!

Re: How to use external dll?

Posted: Sat May 20, 2023 9:40 am
by serge_girard
Thanks Rathi & Grigory !

Re: How to use external dll?

Posted: Sat May 20, 2023 11:47 am
by Anand
Thanks both for your efforts for HMG 64 bit