I work with the camera, the SDK ( http://www.jai.com/en/support/jai_sdk_and_control_tool ) goes to it as a .lib library and heaps of .h files (230 pieces), one of which is the main one (we connect it, and he already connects the rest). The library is installed in the ProgramFiles folder. For writing code, I don’t have to copy it into the project, I can just connect the main header and .lib . But in the future, the program will be installed on other computers, and how will it know where to get the library from? So far, I have copied the library into a project, but more than 200 files in a project are purely for one library - it seems to me somehow not cool ... How is it better to be in this situation?
1 answer
There are two parallel problems - legal (requirements of the authors of the library to the technology of distribution) and technical. Legal will remain aside for the time being, here you need to clarify the license of the library.
Technical:
- The library can be linked statically, then it is already built into your executable file, and nothing needs to be done.
- The library is built dynamically, which means that all
dllfiles should at least be packaged in an installer and put near what is done during installation.
What is undesirable and dangerous to do:
- force the user to search and download the library on the Internet
- place the library in a folder other than the application folder, for example, in the
WINDOWSfolder or in theSYSTEM32folder
Useful tool for working with libraries - Dependency Walker . It allows you to find all the dll on which this exe depends
- Thank you very much for your response. Those. The best variant (technically) is to add this library to my project? Even if it is large (in terms of the number of files). - Jaroslav Chernov
- @JaroslavChernov source code do not need to drag, just dll. - gbg
- It turns out, in my case it is better to connect it dynamically, via dll? And if statically, through .lib, then you have to drag headers? - Jaroslav Chernov
- @JaroslavChernov unfortunately I am not a psychic. I suspect that this library is in the form of a DLL. - gbg
- Thanks, I will understand. - Jaroslav Chernov
|