Ubuntu: Why no library files installed for google test?


The libgtest-dev package seems only install header files to the system, but not the static and dynamic libraries which should be installed under /usr/lib.

Is it a bug?


Is it a bug?

No, it's deliberate:

  gtest (1.6.0-1ubuntu2) precise; urgency=low      * Stop distributing static library (although still build it, to ensure gtest      works).  Upstream recommends against shipping the libary at all, just the      source. (See: http://code.google.com/p/googletest/wiki/FAQ)      The Debian maintainer plans to do this also (see BTS: 639795); do it in      Ubuntu now to fulfil MIR requirements.  

To build static libraries

  cd /usr/src/gtest  sudo cmake .  sudo make  sudo mv libg* /usr/lib/  


Improving on izx's answer I would have used cmake this way:


and I would attempt an out-of-source build:

cd /tmp  mkdir .build  cd .build  cmake -DCMAKE_BUILD_TYPE=RELEASE /usr/src/gtest/  make  sudo mv libg* /usr/lib/  


It should be a dependency bug , libgtest should be installed along with libgtest-dev.

Can you try apt-get install -y libgtest first ?

Also remember to submit a bug report on ubuntu.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »