I am using Ubuntu 12.04, and I compiled a package for object recognition(rein).I got an error indicating that I don't have soci.h:

Error: cannot find SOCI header file: soci.h

I tried to use this command to install libsoci

sudo apt-get install libsoci-core-gcc

But I get the message:

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

Does anybody know how to install this library?Thanks!

P.S.For more detailed information, click here.


The latest ubuntu for which there is a libsoci-core-gcc packages seems to be natty (11.04). These old packages seem to install ok on 12.04, so this is a (very hacky) way of getting /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

A perhaps cleaner way would be to build soci from sources: soci.sourceforge.net and install to your home directory or /usr/local, but that is also more work.


Since Ubuntu Xenial Xerus (16.04) you can use this:

sudo apt-get install libsoci-dev

to install SOCI and dependencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.