[英]Put shared library file in C++ project
I'm looking to use an .so library in a C++ project of mine. 我正在寻找在我的C ++项目中使用.so库的方法。 I have the header file for it and the actual .so has to be somewhere as well; 我有它的头文件,并且实际的.so也必须在某处; I installed them using apt-get. 我使用apt-get安装了它们 。
Since my project is under version management and I don't want everyone who downloads the repository to have to install the packages I installed, I would like to simply put the .so file and the header file somewhere in my project and only use those. 由于我的项目受版本管理,并且我不希望所有下载存储库的人都必须安装我安装的软件包,因此我只想将.so文件和头文件放在我的项目中的某个位置,而仅使用它们。 Never having learned C++ properly, I don't know how I can do this. 从来没有正确学习过C ++,我不知道该怎么做。
If I have an .so library and the header file for it, how do I put them in a folder of my chosing and include them in my source code? 如果我有一个.so库和它的头文件,如何将它们放在选择的文件夹中并将其包含在源代码中?
You have several options: 您有几种选择:
The last solution matches the most what you want, put may be quite difficult to set-up. 最后一种解决方案最符合您的需求,可能很难设置。 There exist several library to easily load a .so file also. 有几个库可以轻松加载.so文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.