Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:31:29+00:00 2026-06-14T17:31:29+00:00

Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate

  • 0

Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project’s makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:31:30+00:00Added an answer on June 14, 2026 at 5:31 pm

    Before you start make sure your have read and understood
    this note from Google! This tutorial makes using gtest easy, but may introduce nasty bugs.

    1. Get the googletest framework

    wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
    

    Or get it by hand. I won’t maintain this little How-to, so if you stumbled upon it and the links are outdated, feel free to edit it.

    2. Unpack and build google test

    tar xf release-1.8.0.tar.gz
    cd googletest-release-1.8.0
    cmake -DBUILD_SHARED_LIBS=ON .
    make
    

    3. "Install" the headers and libs on your system.

    This step might differ from distro to distro, so make sure you copy the headers and libs in the correct directory. I accomplished this by checking where Debians former gtest libs were located. But I’m sure there are better ways to do this.

    sudo cp -a googletest/include/gtest /usr/include
    sudo cp -a googlemock/gtest/libgtest_main.so googlemock/gtest/libgtest.so /usr/lib/
    
    # The easiest/best way:
    make install  # Note: before v1.11 this can be dangerous and is not supported
    

    4. Update the cache of the linker

    … and check if the GNU Linker knows the libs

    sudo ldconfig -v | grep gtest
    

    If the output looks like this:

    libgtest.so.0 -> libgtest.so.0.0.0
    libgtest_main.so.0 -> libgtest_main.so.0.0.0
    

    then everything is fine.

    gTestframework is now ready to use. Just don’t forget to link your project against the library by setting -lgtest as linker flag and optionally, if you did not write your own test main() routine, the explicit -lgtest_main flag.

    From here on you might want to go to Google’s Googletest Primer documentation, and the old docs about the framework to learn how it works. Happy coding!

    Edit:
    This works for OS X too! See "How to properly setup googleTest on OS X"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Renaming a file on Debian Wheezy does not work using fs.rename or fs.renameSync. This
This code does not compile for me on GCC version 4.3.2 (Debian 4.3.2-1.1) main()
Where does debian stores C header files like stdio.h , string.h etc? I am
I am using tomcat6 and java on Debian server. Does anyone know of some
On average, how long does it take for Debian to package new versions of
I'm running a debian stable ThinkPad X1 (1294-3QG) with exactly three packages from squeeze-backports
There is a Debian g++-4.4 package, but it's not Ubuntu. There are too many
I've been searching on how to solve this issue but could not find any
I've noticed that gq does not work when I paste in a long line.
I am stuck with a fairly complex Python module that does not return useful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.