Compile MongoDB C ++ driver on Redhat Linux

Source: Internet
Author: User

 

I downloaded mongodb-linux-x86_64-v1.6-latest.tar.gz, which is used for compiling boost.1.41, but boost in RedHat Linux is 1.33. It is wrong to use it to compile your own program. Therefore, you need to re-compile C ++ driver.

Compiling MongoDB C ++ driver requires the support of the following function libraries

1. Boost download boost_000045_0.tar.gz, installed in/usr/local/

<Omitted>

2. pcre-8.02.tar.gz downloaded by PCRE

# Tar xzf pcre-8.02.tar.gz

# Cd pcre-8.02 ..;./configure

# Make install

 

You also need to install scons, the downloaded scons-2.0.1.noarch.rpm

# Rpm-ihv scons-2.0.1.noarch.rpm

Then you can compile it.

$ Scons -- extrapath =/usr/local

 

$./Firstexample

Using cursor

{"_ Id": {"$ oid": "4db54c518b5341da7a1e916c"}, "name": "Eliot", "num": 15}

{"_ Id": {"$ oid": "4db54c518b5341da7a1e916d"}, "name": "Sara", "num": 23}

0 {"_ id": {"$ oid": "4db54c518b5341da7a1e916c"}, "name": "Eliot", "num": 15}

1 {}

 

It indicates that everything is normal. MongoDB C ++ driver is available.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.