I have created a rust application, which uses the sqlite crate from crates.io
I am just using this crate as is and when I run my application with cargo run, I do get what I want. However, it seems my application has now a dependency to sqlite3.dll , which needs to be in my path.
From the Cargo docs that I read, my understanding is that the sqlite crate itself is linked statically, but not the C Library that it depends on.
On my own computer, I solved this by simply copying the sqlite3.dll into a folder in my path or to the same directory, where cargo has created my executable.
But, I realised that this didn't work with any sqlite3.dll file, but it worked with the one I found somewhere deep under the .multirust folder.
Additionally, when I give this application to someone else, I would also have to make sure that the DLL is also there.
So, I would like to avoid these complications by statically linking this DLL to my executable.
Is there a way to tell Cargo link this C Library statically without diving into custom build scripts?
sqlite3.dllitself isn't, then all bets are off, essentially, or at least it would be if it was linux. I'm not entirely sure about static linking on windows as I've never had to need it, so there may still be a way forward, but it's looking very unlikely. - Sébastien Renauld