安装包库和头文件在哪里?

时间:2014-10-23 13:25:45

标签: linux ubuntu cmake dpkg

在Ubuntu中下载并安装软件包后,如何查看库和头文件的写入位置?我相信这与包的.pc文件有关,但我不知道如何找到该文件。

例如,我已经下载了PCL(Point Cloud Library)软件包,然后在示例CMakeLists.txt文件中,我获得了以下内容:

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

这些环境变量在哪里定义,我怎样才能看到它们?

如果我从源代码而不是通过软件包编译库,这会有什么不同吗?是否会自动创建.pc文件?

2 个答案:

答案 0 :(得分:4)

如果安装包含libpcl开发文件的包

sudo apt-get install libpcl-dev

您可以列出已安装的文件

dpkg -L libpcl-dev

查看所有标题的位置。

...
/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
....

答案 1 :(得分:0)

默认情况下,库安装在/ usr / lib中,头文件位于/ usr / include

通常,库文件的扩展名为.so,相应的头文件为.h

用于查找已安装库的gui方法是开放软件中心 - >开发人员工具 - >库