Wednesday, July 16, 2014

gcc show filename of library

gcc provides the option

 -print-file-name=<library-name>

which is very helpful for debugging linking problems. When invoked with this flag, gcc does not compile/link, but prints the full path that it uses for that library, e.g:

 beethoven:~:% gcc -print-file-name=libvigraimpex.so
 /home/phil/local/lib/../lib/libvigraimpex.so

That way you can easily determine whether or not gcc sees the correct libraries.

No comments:

Post a Comment