Find lib file linux

How to find location of installed library

Background: I’m trying to build my program but first I need to set up libraries in NetBeans. My project is using GLU and therefore I installed libglu-dev. I didn’t note the location where the libraries were located and now I can’t find them. I’ve switched to Linux just a few days ago and so far I’m very content with it, however I couldn’t google this one out and became frustrated. Is there way to find out where files of package were installed without running the installation again? I mean if I got library xxx and installed it some time ago, is there some-command xxx that will print this info? I’ve already tried locate, find and whereis commands, but either I’m missing something or I just can’t do it correctly. For libglu, locate returns:

/usr/share/bug/libglu1-mesa /usr/share/bug/libglu1-mesa/control /usr/share/bug/libglu1-mesa/script /usr/share/doc/libglu1-mesa /usr/share/doc/libglu1-mesa/changelog.Debian.gz /usr/share/doc/libglu1-mesa/copyright /usr/share/lintian/overrides/libglu1-mesa /var/lib/dpkg/info/libglu1-mesa:i386.list /var/lib/dpkg/info/libglu1-mesa:i386.md5sums /var/lib/dpkg/info/libglu1-mesa:i386.postinst /var/lib/dpkg/info/libglu1-mesa:i386.postrm /var/lib/dpkg/info/libglu1-mesa:i386.shlibs 

The other two commands fail to find anything. Now locate did its job, but I’m sure none of those paths is where the library actually resides (at least everything I was linking so far was in /usr/lib or /usr/local/lib ). libglu was introduced just as example. I’m looking for a general solution for this problem.

Источник

Where is my boost lib file?

I am using boost. I installed it using sudo apt-get install . Now I am unable to find my boost lib file on my filesystem. I want to include the path of the lib in my Qt project. grepping is taking too long 🙁 I found the includes in /usr/include/boost . But I also need to know the library path.

Читайте также:  Как удалить профиль линукс

5 Answers 5

If you are on a 64bit machine then you will probably find the files under /usr/lib/x86_64-linux-gnu/

See also this for an explanation of what this folder is for.

I’m not sure if this is what you’re looking for, but you probably want to install libboost-all-dev .

$ ls /usr/lib/libboost*.so /usr/lib/libboost_date_time-mt.so /usr/lib/libboost_date_time.so /usr/lib/libboost_filesystem-mt.so /usr/lib/libboost_filesystem.so /usr/lib/libboost_graph-mt.so /usr/lib/libboost_graph_parallel-mt.so /usr/lib/libboost_graph_parallel.so /usr/lib/libboost_graph.so /usr/lib/libboost_iostreams-mt.so /usr/lib/libboost_iostreams.so /usr/lib/libboost_math_c99f-mt.so /usr/lib/libboost_math_c99f.so /usr/lib/libboost_math_c99l-mt.so /usr/lib/libboost_math_c99l.so /usr/lib/libboost_math_c99-mt.so /usr/lib/libboost_math_c99.so /usr/lib/libboost_math_tr1f-mt.so /usr/lib/libboost_math_tr1f.so /usr/lib/libboost_math_tr1l-mt.so /usr/lib/libboost_math_tr1l.so /usr/lib/libboost_math_tr1-mt.so /usr/lib/libboost_math_tr1.so /usr/lib/libboost_mpi-mt.so /usr/lib/libboost_mpi.so /usr/lib/libboost_prg_exec_monitor-mt.so /usr/lib/libboost_prg_exec_monitor.so /usr/lib/libboost_program_options-mt.so /usr/lib/libboost_program_options.so /usr/lib/libboost_python-mt-py27.so /usr/lib/libboost_python-mt-py32.so /usr/lib/libboost_python-py27.so /usr/lib/libboost_python-py32.so /usr/lib/libboost_python.so /usr/lib/libboost_regex-mt.so /usr/lib/libboost_regex.so /usr/lib/libboost_serialization-mt.so /usr/lib/libboost_serialization.so /usr/lib/libboost_signals-mt.so /usr/lib/libboost_signals.so /usr/lib/libboost_system-mt.so /usr/lib/libboost_system.so /usr/lib/libboost_thread-mt.so /usr/lib/libboost_thread.so /usr/lib/libboost_unit_test_framework-mt.so /usr/lib/libboost_unit_test_framework.so /usr/lib/libboost_wave-mt.so /usr/lib/libboost_wave.so /usr/lib/libboost_wserialization-mt.so /usr/lib/libboost_wserialization.so 

Источник

Where do library C header files go on Linux

Embarrassingly basic question. sudo apt-get install libmemcached6 — where do the .h’s and .o’s or .so’s live in a typical install on a Linux machine (Ubuntu)? And, how do I make sure g++ can pick them up?

g++ can pick them up if they are properly installed because they should be in the PATH. Otherwise, you could compile the library yourself statically and place the output somewhere in a folder of your choice.

3 Answers 3

They go to /usr/include and /usr/lib. If you use the -l option (for the libraries) it should find them from these standard places. If you include using it should also get it from the right place.

Found the so in /usr/lib. No header in /usr/include. Is this likely something not included in an apt-get install and I’ll just need to acquire the source myself?

mostprobably your library has a -dev version that installs the header and this one just installs the runtime requirements (aka the .so) try doing apt-cache search libmemcached6 and see if there’s a libmemcached6-dev package for development files. that will add the header file

Читайте также:  Linux ls with file sizes

Linking with -lmemcached seems like it compiles but fails to link the C functions in, not sure how to tell where to find them (or where they are.)

@djechlin, try running objdump -T /usr/lib/libmemcached.so.6 and checking to make sure the names match what you have in your code.

On Ubuntu (and other Debian variants) you can use the dpkg command to find out. For example:

$ dpkg -L libxml2 /. /usr /usr/share /usr/share/doc /usr/share/doc/libxml2 /usr/share/doc/libxml2/AUTHORS /usr/share/doc/libxml2/NEWS.gz /usr/share/doc/libxml2/TODO.gz /usr/share/doc/libxml2/copyright /usr/share/doc/libxml2/README /usr/share/doc/libxml2/changelog.Debian.gz /usr/share/doc/libxml2/README.Debian /usr/lib /usr/lib/libxml2.so.2.7.8 /usr/lib/libxml2.so.2 

As you can see, Debian packages don’t typically include the .h files; those are normally in corresponding -dev packages. So you can find the header files here:

$ dpkg -L libxml2-dev /. /usr /usr/share /usr/share/doc /usr/share/doc/libxml2-dev /usr/share/doc/libxml2-dev/AUTHORS /usr/share/doc/libxml2-dev/NEWS.gz /usr/share/doc/libxml2-dev/TODO.gz /usr/share/doc/libxml2-dev/copyright /usr/share/doc/libxml2-dev/README /usr/share/doc/libxml2-dev/changelog.Debian.gz /usr/share/aclocal /usr/share/aclocal/libxml2.m4 /usr/share/man /usr/share/man/man3 /usr/share/man/man3/libxml.3.gz /usr/share/man/man1 /usr/share/man/man1/xml2-config.1.gz /usr/include /usr/include/libxml2 /usr/include/libxml2/libxml /usr/include/libxml2/libxml/HTMLtree.h /usr/include/libxml2/libxml/tree.h /usr/include/libxml2/libxml/xmlreader.h /usr/include/libxml2/libxml/xmlschemastypes.h . 

As for gcc , the manual explains how it searches for header files. Note that this is different and separate from using -l to instruct the linker to link with a certain library.

Источник

Where are package library and header files installed?

After downloading and installing a package in Ubuntu, how can I check where the library and header files were written to? I believe that this has something to do with the package’s .pc file, but I do not know how to find that file either. For example, I have downloaded the PCL (Point Cloud Library) package, and then in a sample CMakeLists.txt file, I have been given the following:

include_directories($) link_directories($) add_definitions($) 

Where are these environment variables defined, and how can I see them? If I compiled the libraries from source rather than through a package, will this be any different? Will a .pc file be created automatically?

Читайте также:  Linux which driver is device using

That just returns an empty line. However, compiling my project as above works fine so it must be using the PCL libraries. Is it searching anywhere else?

If you installed a debian package you can see the content via dpkg -L . If you install from source, it depends heavily on the source and you need to familiarise yourself with the build system it uses.

I had similar confusions. You can check to what values $ resolves to by using message command in your CMakeLists.txt i.e. add this line: message(«$) or message(«PCL_INCLUDE_DIRS = » $) . It will display the result when you run cmake .. Do the same for other macros/variables i.e. $ and $

2 Answers 2

If you install the package containing the libpcl development files

sudo apt-get install libpcl-dev 

You can list the installed files

an see the location of all headers.

. /usr/include/pcl-1.7/pcl/filters/fast_bilateral.h /usr/include/pcl-1.7/pcl/filters/voxel_grid_covariance.h /usr/include/pcl-1.7/pcl/filters/voxel_grid_occlusion_estimation.h /usr/include/pcl-1.7/pcl/filters/median_filter.h /usr/include/pcl-1.7/pcl/filters/crop_box.h /usr/include/pcl-1.7/pcl/filters/voxel_grid_label.h /usr/include/pcl-1.7/pcl/filters/covariance_sampling.h /usr/include/pcl-1.7/pcl/filters/random_sample.h /usr/include/pcl-1.7/pcl/filters/normal_refinement.h /usr/include/pcl-1.7/pcl/filters/project_inliers.h /usr/include/pcl-1.7/pcl/filters/fast_bilateral_omp.h /usr/include/pcl-1.7/pcl/filters/clipper3D.h /usr/include/pcl-1.7/pcl/filters/convolution.h /usr/include/pcl-1.7/pcl/filters/passthrough.h /usr/include/pcl-1.7/pcl/filters/conditional_removal.h /usr/include/pcl-1.7/pcl/filters/impl /usr/include/pcl-1.7/pcl/filters/impl/frustum_culling.hpp /usr/include/pcl-1.7/pcl/filters/impl/conditional_removal.hpp /usr/include/pcl-1.7/pcl/filters/impl/convolution_3d.hpp /usr/include/pcl-1.7/pcl/filters/impl/voxel_grid_covariance.hpp /usr/include/pcl-1.7/pcl/filters/impl/fast_bilateral_omp.hpp /usr/include/pcl-1.7/pcl/filters/impl/project_inliers.hpp /usr/include/pcl-1.7/pcl/filters/impl/morphological_filter.hpp /usr/include/pcl-1.7/pcl/filters/impl/crop_box.hpp /usr/include/pcl-1.7/pcl/filters/impl/covariance_sampling.hpp /usr/include/pcl-1.7/pcl/filters/impl/local_maximum.hpp /usr/include/pcl-1.7/pcl/filters/impl/plane_clipper3D.hpp /usr/include/pcl-1.7/pcl/filters/impl/bilateral.hpp /usr/include/pcl-1.7/pcl/filters/impl/voxel_grid_occlusion_estimation.hpp . 

Источник

Оцените статью
Adblock
detector