0

I have Ubuntu 14.04 upgraded from 12.04 making dist-upgrades. I did many manual installations such as ffmpeg, libglib and so on, in the past. I have a nice custom distro now, it works well but I have problems while trying to compile applications. The errors I got taught me lots, I found how to deal with linker errors, I list some of them below:

how-can-i-guide-compiler-to-use-a-certain-library

how-to-fix-pkg-prog-pkg-config-command-not-found-error

pkg-config-modversion-glib-2-0-reports-older-version

how-to-fix-libgmodule-2-0-so-0-could-not-read-symbols-invalid-operation-erro

multiple-ffmpeg-library-paths-how-can-exclude-older-ffmpeg-installations

how-can-i-use-a-particular-library-while-compiling

I come to such a point that even I can get errors while compiling native Ubuntu applications such as unity (I want to embed unity launcher into cairo dock unity launcher in cairo dock)

How can I fix those library conflicts? I lost manually compiled application's directories so I have no chance to run make uninstall.

I am fed up with adjusting library paths. What do you suggest me in this position?

kenn
  • 5,232

1 Answers1

1

The main issue here was the existence of libraries and includes in /usr/local that were compiled in Precise (12.04).

When searching for the development headers specified by #include, gcc and g++ have /usr/local/include higher on the list than /usr/include. Therefore, if you have a library's dev headers in both /usr/local/include and /usr/include, then the one in /usr/local/include will be used, regardless of the version. While this may have been fine in Precise, since the libraries that were locally compiled were likely newer versions, this wouldn't be fine in Trusty, when the system version of the library would be of a equal or newer version of the library you installed. In addition, as system libraries changed, the SONAMEs would have changed, and locally-compiled libraries would have to be recompiled. Therefore, gcc/g++ would use the older version and may complain about missing symbols and/or linking errors.

If a library is present in the main repos, it is generally recommended to use that library instead of compiling it by yourself (unless you need a newer version of a library for either development or to fix a bug); that way, when you upgrade your system, that library is updated as well, and recompiled to link correctly with the other libraries.

saiarcot895
  • 10,917