Linux 在 Ubuntu 上安装 C++ 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8334842/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 02:39:29  来源:igfitidea点击:

Installing C++ library on Ubuntu

c++linuxubuntudevil

提问by Rooster

I must be a noob, always have trouble installing on Linux. I'm trying to install from: http://openil.sourceforge.net/download.php. So I followed the manual (http://openil.sourceforge.net/docs/index.php) using DevIL 1.7.8 tar.gz from the DL page.

我一定是个菜鸟,在 Linux 上安装总是有问题。我正在尝试从以下位置安装:http://openil.sourceforge.net/download.php。所以我按照手册 (http://openil.sourceforge.net/docs/index.php) 使用来自 DL 页面的 DevIL 1.7.8 tar.gz。

  1. I see no precompiled .so's as the manual states.

  2. It try to compile myself and I see no OpenIL additions to usr/lib or usr/include (as the manual states) after doing a config,build,install.

  3. I supposedly installed it through package manager...but I still don't know where the files I need to include/link to are.

  1. 我看到没有预编译的 .so 就像手册所说的那样。

  2. 它尝试自己编译,在执行配置、构建、安装后,我没有看到 usr/lib 或 usr/include 中的 OpenIL 添加项(如手册所述)。

  3. 我应该是通过包管理器安装的……但我仍然不知道我需要包含/链接到的文件在哪里。

UPDATE: A closer look at the install output for 2. above shows that stuff was actually installed under user/local (thanks alot manual).

更新:仔细查看上面 2. 的安装输出表明这些东西实际上是安装在用户/本地下的(非常感谢手册)。

So just to be certain, how do I go about linking the .so and the .h to my program.

所以只是为了确定,我如何将 .so 和 .h 链接到我的程序。

采纳答案by jwir3

As for 3:

至于3:

Here's what I did (Ubuntu 11.04):

这是我所做的(Ubuntu 11.04):

$ sudo apt-get install libdevil1c2 libdevil-dev
$ apt-file show libdevil1c2
libdevil1c2: /usr/bin/ilur
libdevil1c2: /usr/lib/libIL.so.1
libdevil1c2: /usr/lib/libIL.so.1.1.0
libdevil1c2: /usr/lib/libILU.so.1
libdevil1c2: /usr/lib/libILU.so.1.1.0
libdevil1c2: /usr/lib/libILUT.so.1
libdevil1c2: /usr/lib/libILUT.so.1.1.0
libdevil1c2: /usr/share/doc/libdevil1c2/changelog.Debian.gz
libdevil1c2: /usr/share/doc/libdevil1c2/copyright
libdevil1c2: /usr/share/lintian/overrides/libdevil1c2