How to set up googleTest as a shared library on Linux

后端 未结 12 2600
北荒
北荒 2020-11-28 01:04

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 cl

12条回答
  •  余生分开走
    2020-11-28 01:47

    Just in case somebody else gets in the same situation like me yesterday (2016-06-22) and also does not succeed with the already posted approaches - on Lubuntu 14.04 it worked for me using the following chain of commands:

    git clone https://github.com/google/googletest
    cd googletest
    cmake -DBUILD_SHARED_LIBS=ON .
    make
    cd googlemock
    sudo cp ./libgmock_main.so ./gtest/libgtest.so gtest/libgtest_main.so ./libgmock.so /usr/lib/
    sudo ldconfig
    

提交回复
热议问题