Ubuntu 20.04:Cmake 错误:找不到 ALSA(缺少:ALSA_LIBRARY ALSA_INCLUDE_DIR)

Ubuntu 20.04:Cmake 错误:找不到 ALSA(缺少:ALSA_LIBRARY ALSA_INCLUDE_DIR)

cmake当我尝试编译 Buildroot 系统时出现了奇怪的错误。

由于 hello 包不需要 ALSA,因此 cmake 在检查 ALSA 是否存在时似乎崩溃了。我已经安装了libasound2libasound2-dev

我自己编译过cmake(安装 ALSA 库后重复了步骤),但没有变化。有什么建议,可以帮忙解决这个问题吗?

> make[1]: Entering directory '/home/robi/Razvoj/LinuxWork/Buildroot/buildroot'
>>> hello 1.0 Configuring
(mkdir -p /home/robi/Razvoj/LinuxWork/Buildroot/buildroot/output/build/hello-1.0/ && cd /home/robi/Razvoj/LinuxWork/Buildroot/buildroot/output/build/hello-1.0/ && rm -f CMakeCache.txt && PATH="/home/robi/Razvoj/LinuxWork/Buildroot/buildroot/../host/bin:/home/robi/Razvoj/LinuxWork/Buildroot/buildroot/../host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"  /usr/local/bin/cmake /home/robi/Razvoj/LinuxWork/Buildroot/buildroot/output/build/hello-1.0/ -DCMAKE_TOOLCHAIN_FILE="/home/robi/Razvoj/LinuxWork/Buildroot/buildroot/../host/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_DOC=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLE=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TEST=OFF -DBUILD_TESTS=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF   )
-- The C compiler identification is GNU 8.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/robi/Razvoj/LinuxWork/Buildroot/host/bin/arm-buildroot-uclinux-uclibcgnueabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found SDL: /home/robi/Razvoj/LinuxWork/Buildroot/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libSDLmain.a;/home/robi/Razvoj/LinuxWork/Buildroot/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libSDL.a (found version "1.2.15") 
-- Found SDL_ttf: /home/robi/Razvoj/LinuxWork/Buildroot/host/arm-buildroot-uclinux-uclibcgnueabi/sysroot/usr/lib/libSDL_ttf.a (found version "2.0.11") 
CMake Error at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.18/Modules/FindALSA.cmake:60 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:6 (find_package)

答案1

用于sudo apt-get install libasound2-dev安装缺少的软件包。

相关内容