AD Teaching Wiki:

Installing the Google C++ Testing Framework (gtest) globally

Step 1: Change into the temporary directory, for example:

cd /tmp

Step 2: Download the latest (major) version from https://github.com/google/googletest/releases, for example:

wget https://github.com/google/googletest/archive/release-1.11.0.zip

Step 3: Unpack the archive, change to the corresponding directory and build the code from its source (this requires cmake which can be installed using your favorite package manager, for example: apt on Ubuntu or brew on Mac):

unzip release-1.11.0.zip
cd googletest-release-1.11.0
mkdir build
cd build
cmake .. -DBUILD_GMOCK=OFF
make
sudo make install

(optional) Step 5: If the library is (still) not found by the compiler, you can run (as root or with sudo):

ldconfig

(optional) Step 6: Clean up:

cd /tmp
rm -rf release-1.11.0.zip googletest-release-1.11.0

Troubleshooting

AD Teaching Wiki: Manuals/Gtest (last edited 2022-04-19 22:49:31 by Johannes Kalmbach)