Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have installed libgoogle-perftools-dev via software center in Ubuntu 12.04. As suggested by http://pj.freefaculty.org/blog/?p=140, I want to add to my cpp file:

#include <gperftools/profiler.h>

But the compiler says

 gperftools/profiler.h: No such file or directory

I tried to find where it is:

$ locate -i gperftools

no return, and

$ locate -i "profiler.h"

returns

/usr/include/c++/4.6/profile/impl/profiler.h
/usr/src/linux-headers-3.2.0-23-generic-pae/include/config/function/profiler.h

which I am not sure if are for gperftools.

So I wonder how to find

  • where libgoogle-perftools-dev is installed?
  • where gperftools/profiler.h is located?
share|improve this question

2 Answers 2

up vote 8 down vote accepted

Probably the issue with the locate command is that the database has not yet been updated to reflect the newly-installed package files. You could force an update (sudo updatedb) or use the find command instead, but probably the easiest solution on systems like Ubuntu that use the dpkg package management tools is to list the package contents

dpkg -L libgoogle-perftools-dev

or to check for the profiler.h file location specifically

dpkg -L libgoogle-perftools-dev | grep 'profiler.h'
share|improve this answer

Usually, pkg-config helps in most of these cases pkg-config --list-all lists packages that are "known" to your system. And then pkg-config --clibs --flags <package> is good enough to provide linker and include information.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.