CMake 未检测到我知道已安装的包

问题描述 投票:0回答:0

我在 Ubuntu (22.04LTS) 上使用 cmake (3.22.1) 从源代码编译 tigervnc (1.13.0)。除了一个,我已经满足了所有的依赖。

我的构建失败并出现错误:“找不到 PAM 开发文件”。我安装了包 libpam0g-dev,我知道有问题的 PAM 开发文件位于:/usr/include/security/pam_appl.h.

如何让 CMake 找到文件?任何帮助将不胜感激。谢谢!

Determining if files security/pam_appl.h exist failed with the following output:
Change Dir: /usr/local/src/tigervnc/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_da0c0/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_da0c0.dir/build.make CMakeFiles/cmTC_da0c0.dir/build
gmake[1]: Entering directory '/usr/local/src/tigervnc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_da0c0.dir/HAVE_PAM_H.c.o
/usr/bin/cc   -std=gnu99 -Wall -Wextra -Wformat=2 -Wvla  -o CMakeFiles/cmTC_da0c0.dir/HAVE_PAM_H.c.o -c /usr/local/src/tigervnc/CMakeFiles/CheckIncludeFiles/HAVE_PAM_H.c
/usr/local/src/tigervnc/CMakeFiles/CheckIncludeFiles/HAVE_PAM_H.c:2:10: fatal error: security/pam_appl.h: No such file or directory
    2 | #include <security/pam_appl.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTC_da0c0.dir/build.make:78: CMakeFiles/cmTC_da0c0.dir/HAVE_PAM_H.c.o] Error 1
gmake[1]: Leaving directory '/usr/local/src/tigervnc/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_da0c0/fast] Error 2


Source:
/* */
#include <security/pam_appl.h>


int main(void){return 0;}

Determining if the function pam_start exists failed with the following output:
Change Dir: /usr/local/src/tigervnc/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_4a751/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_4a751.dir/build.make CMakeFiles/cmTC_4a751.dir/build
gmake[1]: Entering directory '/usr/local/src/tigervnc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_4a751.dir/CheckFunctionExists.c.o
/usr/bin/cc   -std=gnu99 -Wall -Wextra -Wformat=2 -Wvla -DCHECK_FUNCTION_EXISTS=pam_start -o CMakeFiles/cmTC_4a751.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.22/Modules/CheckFunctionExists.c
Linking C executable cmTC_4a751
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4a751.dir/link.txt --verbose=1
/usr/bin/cc  -std=gnu99 -Wall -Wextra -Wformat=2 -Wvla -DCHECK_FUNCTION_EXISTS=pam_start CMakeFiles/cmTC_4a751.dir/CheckFunctionExists.c.o -o cmTC_4a751  -lpam
/usr/bin/ld: cannot find -lpam: No such file or directory
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_4a751.dir/build.make:99: cmTC_4a751] Error 1
gmake[1]: Leaving directory '/usr/local/src/tigervnc/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_4a751/fast] Error 2
cmake vnc pam ubuntu-22.04
© www.soinside.com 2019 - 2024. All rights reserved.