开发者

Confused in using opensource 3rd party libraries

开发者 https://www.devze.com 2023-01-13 08:04 出处:网络
How do you integrate C or C+开发者_StackOverflow中文版+ open-source third party libraries in your projects? Do you copy all the files it comes with (I.e. README, makefiles etc) to a separate directory

How do you integrate C or C+开发者_StackOverflow中文版+ open-source third party libraries in your projects? Do you copy all the files it comes with (I.e. README, makefiles etc) to a separate directory somewhere inside the project and build it using its configs? Or do you only get needed source files and headers from a source package? Or do you just install pre-build binaries?

What's better if I'm making a very little non-GUI project for both Windows and Linux?


The generic way is to put in your README and INSTALL that you depend on a library and that the user should download and install the shared library. Then link against that shared library at compile time.

Never put the source into your own application unless theres a good reason (like gnulib).

Your application should have nothing to do with the installation of the third party package - leave that to the user. When they use rpm, deb, ports, or portage with the packages you build, which tell what it depends on, the other package will be automatically installed.

0

精彩评论

暂无评论...
验证码 换一张
取 消