How can I incorporate libraries into my executable, so that users don't need to have the DLLs?
I'm developing software using ITK and VTK, and it's all going very well. However, I would like to deploy the software onto end-user machines that do not have ITK or VTK installed. When I build the software, and run it on a machine that doesn't have the ITK or VTK installed, I get errors, such as "Cannot load li开发者_运维技巧bItkBasicFilters.dll" This makes perfect sense--there are no such DLLs on the machine.
I can't expect all my users to install ITK so that they can run my software--how can I make it so that they only have to run my executable, and they can enjoy the software? I'm afraid I don't understand these libraries well enough--so if you can give me any ideas, that would be very helpful.
You have two options:
- Add the installer of those libraries into your installer and run it automatically if the libraries are not found on the system. This is how it's usually done if you have an installer and is the preferred option in that case.
- Use static version of the libraries. Since the libraries use BSD license, you are allowed to do this (just recompile them as static libraries if you don't have those already). It will however take more space on the target computer and require reinstalling your software if the libraries need to be updated (.dlls can be updated for bug or security issue fixing without recompiling the dependent applications), but if you want the user to just fetch an .exe and start it, it's the only option.
精彩评论