PDA

View Full Version : Debugging existing CMake project - "error loading shared libraries: libmpc"



mke48
23rd February 2015, 19:18
I just installed QT creator and I have an existing program with tons of C++ source files that I compiled before using CMakeLists and make on my Linux machine. I opened that project on Qt and went to Debug->Start debugging, but I get an error message "error while loading shared libraries: libmpc.so.3: cannot open shared object file: no such file or directory". However, this doesn't make sense because when I used `make` before, I never got this error. Am I doing something wrong?

ChrisW67
23rd February 2015, 20:15
The run time environment your program finds itself in does not include libmpc.so. This is not the Qt library or Cmake's fault.
Check that libmpc is available on your system.
Check that the run environment in Qt Creator on the Projects tab contains what it should, particularly the LD_LIBRARY_PATH if libmpc is not in a system default library location.

mke48
23rd February 2015, 22:30
The run time environment your program finds itself in does not include libmpc.so. This is not the Qt library or Cmake's fault.
Check that libmpc is available on your system.
Check that the run environment in Qt Creator on the Projects tab contains what it should, particularly the LD_LIBRARY_PATH if libmpc is not in a system default library location.

Why do I need libmpc.so? I didn't need it when I compiled the project using `make`. When I tried to search for its location, I see lots of directories, but they all say `Permission denied` on the command prompt

I also did not list the entire message in the OP. It is:
/opt/apps/ossw/applications/gcc/gcc-4.6/sl6/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1plus:-1: error: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory

ChrisW67
24th February 2015, 08:21
Now that makes a difference: a compile time error, not a run time error. It is your compiler that requires libmpc to execute and cannot find it (libmpc is a normal dependency for GCC). This command would likely show "not found" libraries:


ldd /opt/apps/ossw/applications/gcc/gcc-4.6/sl6/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1plus

Reinstall this compiler and the libraries it depends on, or select a compiler that does work.