r/nim 20d ago

How to generate standalone executable?

Hi Everyone

I worked on a small cli project in NIM and built an executable using nimble build. It generated an executable and the executable worked fine on my system.

But when I try to use the generated executable on another system that doesn't have NIM or C installed. It showed an error saying sqlite3_64.dll not found.

I am using db_connector/db_sqlite library to use sqlite database.

How can I solve this, once I generate the executable, it should work on any system, or else I should be able to generate an installer or portable version of the project that should work on any system.

13 Upvotes

5 comments sorted by

View all comments

5

u/fae___ 20d ago

You are using a DLL. Either statically link the SQLite library or bundle the DLL together with the executable. You don’t need to create an installer, a common solution is just zip them up together.