Linux Gtest Installation

Source: Internet
Author: User

1. Install the CMake, the specific steps here is unknown.

2. Download Source: https://codeload.github.com/google/googletest/zip/release-1.8.0

3. Decompression Source:unzip Googletest-release-1.8.0.zip

4. Enter the source directory:CD googletest-release-1.8.0

5. Create and enter directory Build:mkdir build && CD Build

6. Compiling:cmake. && Make

7. Copy the generated libgtest.a and libgtest_main.ato/usr/local/lib/down

sudo cp libgtest.a libgtest_main.a/usr/local/lib/

8. Copy the Gtest folder in the include to the/usr/local/include

CD googletest-release-1.8.0

sudo cp-rf include/*/usr/local/include/

9. Using Gtest

Write a Test.cpp

g++-O test test.cpp-lgtest-lgtest_main-lpthread

You do not need to specify a path here because:

/usr/local/lib path, existing in/etc/ld.so.conf

/usr/local/include path, existing in/etc/profile

Linux Gtest Installation

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.