In my case, the problem was that there was only libprofiler.so.0 , and no libprofiler.so in /usr/lib/ :
user@compy :/usr/include$ dpkg -L libgoogle-perftools4 /. /usr /usr/share /usr/share/doc /usr/share/doc/libgoogle-perftools4 /usr/share/doc/libgoogle-perftools4/README.Debian /usr/share/doc/libgoogle-perftools4/copyright /usr/lib /usr/lib/libprofiler.so.0.4.5 /usr/lib/libtcmalloc.so.4.2.6 /usr/lib/libtcmalloc_debug.so.4.2.6 /usr/lib/libtcmalloc_and_profiler.so.4.2.6 /usr/share/doc/libgoogle-perftools4/AUTHORS /usr/share/doc/libgoogle-perftools4/TODO /usr/share/doc/libgoogle-perftools4/README.gz /usr/share/doc/libgoogle-perftools4/NEWS.gz /usr/share/doc/libgoogle-perftools4/changelog.Debian.gz /usr/lib/libtcmalloc.so.4 /usr/lib/libtcmalloc_and_profiler.so.4 /usr/lib/libprofiler.so.0 /usr/lib/libtcmalloc_debug.so.4
I donβt know what the official fix is, but I just created a symlink in / usr / lib:
user@compy :/usr/lib$ sudo ln -s libprofiler.so.0 libprofiler.so
This will do the -lprofiler job.
If you don't mind changing your Makefile, you can instead specify -l:libprofiler.so.0 instead of -lprofiler (note the extra colon) ( source ).
EDIT: The official way to get .so apparently to install the libgoogle-perftools-dev package, as described here :
user@compy :/usr/lib$ dpkg -S libprofiler.so libgoogle-perftools-dev: /usr/lib/libprofiler.so libgoogle-perftools4: /usr/lib/libprofiler.so.0.4.5 libgoogle-perftools4: /usr/lib/libprofiler.so.0
I understand that if you want to link to a specific lib library, you must install the libx-dev package, which will contain /usr/lib/libx.so . This file will only be a symlink to a specific version, for example /usr/lib/libx.so.1.2 . When you contact /usr/lib/libx.so by pointing -lx to your linker, you will actually create a link in your program against the specific version linked at that time by writing SONAME from libx.so.1 (the last version number is deleted as oaled here ). Therefore, when you run your program at a later point in time, the dynamic linker will only look for /usr/lib/libx.so.1 , which is symbolically associated with /usr/lib/libx.so.1.2 , and no /usr/lib/libx.so , therefore, the dev package must exist.
So, libx-dev packages libx-dev designed to compile and bind to libx , and the libx package libx designed to run a precompiled program with libx .