문제

I am trying the google performance tool for CPU time profiling. However, I had encountered some problem that I cannot read the shared library file "libprofiler.so.0"

I had read the README of google performace tool, there are 3 steps in the manual:

  1. Compile my program with -lprofiler. I had done this part without any problem.

  2. Run the binary of my program to generate a profile result file.
    I failed in this step. When I try to run my binary, there is an error message:
    "error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory.".
    I googled, in this page, someone says the "libprofiler.so.0" is at "/usr/local/lib", so I copied the share library file to the directory with my binary, and tried to run my binary. It still report the same error message.

I had just used Linux for about one year, please forgive me if my question is very stupid. And, thank you in advance.

My machine information:

  • OS: Ubuntu 8.10
  • Compiler: gcc 4.3.2
  • shell: bash
  • google performance tool version: 1.4 (I had download it just today)
도움이 되었습니까?

해결책

Where is your libprofiler.so.0?

It should be installed into /usr/local/lib or /usr/lib. Copying it to the same directory where your binary resides is useless (as you've already discovered).

EDIT: Apparently libprofiler.so.0 is installed in /usr/local/lib. You probably should just run /sbin/ldconfig (as root) to update loader shared library cache. Setting LD_LIBRARY_PATH should not be necessary (unless you have very non-standard glibc installation).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top