如何获取 soci.h?

如何获取 soci.h?

我正在使用 Ubuntu 12.04,并且我编译了一个用于对象识别的包(rein)。我收到一个错误,表明我没有 soci.h:

Error: cannot find SOCI header file: soci.h

我尝试使用此命令来安装 libsoci

sudo apt-get install libsoci-core-gcc

但我收到了这样的信息:

E: can't find package libsoci-core-gcc

有人知道如何安装这个库吗?谢谢!

PS如需更多详细信息,点击这里

答案1

最新的 ubuntu 似乎有一个 libsoci-core-gcc 软件包 (11.04)。这些旧软件包似乎可以在 12.04 上正常安装,因此这是一种 (非常 hacky) 的获取方式/usr/include/soci/soci.h

curl -O http://security.ubuntu.com/ubuntu/pool/universe/s/soci/libsoci-core-gcc_3.0.0+cvs20081223-4build2_amd64.deb
curl -O http://security.ubuntu.com/ubuntu/pool/universe/s/soci/libsoci-core-gcc-dev_3.0.0+cvs20081223-4build2_amd64.deb
sudo dpkg --install libsoci-core-gcc_3.0.0+cvs20081223-4build2_amd64.deb libsoci-core-gcc-dev_3.0.0+cvs20081223-4build2_amd64.deb

一个可能更清洁的方法是从以下来源构建社交:soci.sourceforge.net并安装到您的主目录或 /usr/local,但这也需要更多工作。

答案2

从 Ubuntu Xenial Xerus (16.04) 开始你可以使用这个:

sudo apt-get install libsoci-dev

安装 SOCI 和依赖项。

相关内容