CMAKE所需的标头系统/Stat.h找不到
CMAKE Required header sys/stat.h not found
我正在尝试配置使用cmake的bcl2fastq程序。我找到了触发此错误消息的行
file:bcl2fastq/src/cmake/cxxConfigure.cmake
############## content ####################
..... # ignoring many lines
bcl2fastq_find_header_or_die(HAVE_SYS_STAT_H sys/stat.h)
......# more lines following
错误消息:
-- time.h found as /usr/include/time.h
-- unistd.h found as /usr/include/unistd.h
CMake Error at cmake/macros.cmake:80 (message):
Required header sys/stat.h not found.
Call Stack (most recent call first):
cmake/cxxConfigure.cmake:41 (bcl2fastq_find_header_or_die)
cxx/CMakeLists.txt:34 (include)
在我的系统上,sys/stat.h
位于
/usr/include/x86_64-linux-gnu
过去,我将/usr/include
中的符号链接添加到sys/stat.h
,该链接修补了问题。有人可以通过修改CMAKE文件提出更好的方法吗?
更深入地挖掘,我在与cxxConfigure.cmake
的目录中找到了macros.cmake
文件,其中包含宏定义:
#
# Macro to find libraries, with support for static-only search
#
macro(bcl2fastq_find_header_or_die variable file)
find_file(${variable} ${file} HINTS ENV C_INCLUDE_PATH ENV CPATH ENV CPLUS_INCLUDE_PATH)
if (${variable})
message(STATUS "${file} found as ${${variable}}")
else (${variable})
message(FATAL_ERROR "Required header ${file} not found.")
endif (${variable})
endmacro(bcl2fastq_find_header_or_die)
然后我做了以下操作:
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
之后,Cmake似乎很高兴。不确定这是解决此问题的正确方法。
导出环境变量如
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
是一种用途。
此外,根据find_path
命令的DOC,PATHS
应在HINTS
上用于硬编码猜测,这意味着像This
macros.cmake
find_file([...] PATHS /usr/include/x86_64-linux-gnu)
更合适。为了提高灵活性,它也可以与PATHS ENV
变量结合使用。在此处的CMAKE邮件列表中也询问了PATHS
vs HINTS
的使用,但是该解释的提供并不比文档条目提供更多。
我创建了一个名为sys in/usr/include的文件夹。
通过stat.h复制到该文件夹中,然后再次运行make命令。BCL2FASTQ构建完成没有任何问题。
在代码中写<sys/stat.h>
而不是<stat.h>
。
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- 找不到QtResource文件中的文件
- VC++本机单元测试,找不到调试符号
- RegGetValue在当前用户下找不到名称
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- c++找不到具有相同哈希的无序集合元素
- 找不到以下加速库:boost_fiber
- 找不到 FLTK(缺少:FLTK_INCLUDE_DIR)
- 设置 Visual Studio for MPI: 找不到标识符错误
- "assimp/config.h"找不到,但它在文件夹中
- 链接器找不到在虚拟类 c++ 中访问的静态字段的符号
- C++系统找不到指定的文件错误
- FindPackageHandleStandardArgs.cmake:137 的 CMake 错误(消息):找不到 Boost (缺少:正则表达式)(找到合适的版本"1.72.0",
- vcpkg 添加新库,但找不到
- Qt 5.11.2 (Clang 8.0 (Apple), 64 位), 找不到 QJSEngine 文件
- CMAKE所需的标头系统/Stat.h找不到