我正在尝试编译一段非常旧的代码- wireshark版本1.9.2,在Ubuntu上。当我运行命令cmake..出现以下错误。
CMake Error at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:76 (message):
Unknown language:
C
Supported languages: C, CXX.
Call Stack (most recent call first):
cmake/modules/FindGLIB2.cmake:241 (CHECK_INCLUDE_FILES)
CMakeLists.txt:385 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/tusharsing/wireshark-1.9.2/build/CMakeFiles/CMakeOutput.log".
这一警告也在它之前。
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:71 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "C" will no longer be dereferenced when the policy is
set to NEW. Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
cmake/modules/FindGLIB2.cmake:241 (CHECK_INCLUDE_FILES)
CMakeLists.txt:385 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
我该怎么办?
1条答案
按热度按时间lsmd5eda1#
我试着用cmake 3.23构建this_commit。你失败的地方会通过这个cmake版本。因此,作为一种选择,如果可能的话,我建议您使用稍后的cmake。
进一步的分析
问题发生在这里
cmake/modules/FindGLIB2.cmake:241
可以像这样将语言传递给
CHECK_INCLUDE_FILES
或使用未加引号的
C
作为第二种方法,可以使用它提供的另一个模块CheckIncludeFile和宏。潜在的好处是,它不会比较变量和字符串文字来验证正确的语言,并且默认使用C