如何修复 “fatal error: security/pam_modules.h: No such file or directory”

如何修复 “fatal error: security/pam_modules.h: No such file or directory”

2015年5月26日1 次浏览来源:Linux中国阅读原文

问题: 我尝试在 [某某 Linux 发行版] 上编译程序,但是出现下面的编译错误:

"pam_otpw.c:27:34: fatal error: security/pam_modules.h: No such file or directory"

我怎样才能修复这个错误?

缺失的头文件 'security/pam_modules.h' 是 libpam 开发版的一部分,一个 PAM(Pluggable Authentication Modules:插入式验证模块)库。因此要修复这个错误,你需要安装 libpam 开发包,如下所示。

对于 Debian、 Ubuntu 或者 Linux Mint:

$ sudo apt-get install libpam0g-dev

对与 CentOS、 Fedora 或者 RHEL:

$ sudo yum install gcc pam-devel

现在验证缺失的头文件是否安装到了 /usr/include/security。

分享
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

About

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools