CentOS view which packages provide the specified header file

Source: Internet
Author: User

"Problem": When the project was migrated, the normal code on SuSE was reported incorrectly on CentOS:

g++-g-wall-fpic-i. /include-i./-I.. /src-i/share/comm_ext-i/home/appadmin/workspace/comm/export_include/-i/home/appadmin/workspace/comm/export_ include/c2cplatform-i/home/appadmin/workspace/comm/export_include/app_platform-i/home/appadmin/workspace/comm/ export_include/app_platform/2.4. 1 -C. /include/myutil/net_util.cpp . /include/myutil/net_util.cpp:5:$: Error: Stropts.h: no file or directory

"Find Reason"

1. "Stropts.h" appears to be a system-supplied header file, and in what directory?

Use the following command on SuSE:

g++-g-wall-fpic-i. /include-i./-I.. /src-i/share/comm_ext-i/home/appadmin/workspace/comm/export_include/-i/home/appadmin/workspace/comm/export_ include/c2cplatform-i/home/appadmin/workspace/comm/export_include/app_platform-i/home/appadmin/workspace/comm/ export_include/app_platform/2.4. 1 - e . /include/myutil/net_util.CPP >util.i

Preprocessing with the-e option of g++ (for more information about the-e option, please search by yourself)

Open Util.i, with the following content:

1 " /usr/include/stropts.h " 1 3 4

This file is located in/usr/include/stropts.h on SuSE.

2. On CentOS, there is really no/usr/include/stropts.h file:

Find /usr-name *stropts.h*find: "/usr/lib64/audit": Insufficient permissions

In other words, the environment on CentOS is really missing the header file

3. If it is missing, install it. The first thing to know is, which package does the header file belong to?

Yum provides */stropts.hloaded plugins:fastestmirrorloading mirror speeds from cached hostfile1< /c2>:compat-glibc-headers-2.5-46.2 for development using standard C libraries. Repo        : basematched from:filename    /usr/lib/x86_64-redhat-linux5e/include/stropts.hfilename    /usr/lib/x86_64-redhat-linux5e/include/bits/stropts.hfilename    /usr/lib/x86_64- Redhat-linux5e/include/sys/stropts.h

The compat-glibc-headers-2.5-46.2.x86_64 package provides the header files we need, we just need to install the package on the line.

4. Confirm that the package has been installed before:

$YumList|grepinstalledcollabnetsubversion-client.x86_641.8.Ten-2installedimagemagick.x86_646-7installedCPP. x86_644.1.2- -. El5 installeddal_auto_script.i5861-3installeddal_auto_script_set.i5861-3installedGCC. x86_644.1.2- -. El5 installedGCC-c++.x86_644.1.2- -. El5 installedlibgcc.x86_644.1.2- -. El5 INSTALLEDLIBSTDC++.x86_644.1.2- -. El5 INSTALLEDLIBSTDC++-devel.x86_644.1.2- -. El5 installedperl_crontab.i5861-0installedpublic_scripts.i5861-8installedwget. x86_641.12-1.8. EL6 Installed

If not, then install it ...

CentOS view which packages provide the specified header file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.