bamtools包中的一个头文件,例如BamReader.h,安装在
/usr/local/include/bamtools/api
我试图将include标志设置为:
CXXFLAGS="$CXXFLAGS -I/usr/local/include/bamtools"
or
CXXFLAGS="$CXXFLAGS -I/usr/local/include/bamtools/api"
AC_CHECK_HEADERS([BamReader.h], [bamtools_found=yes], [AC_MSG_ERROR([Unable to find bambools header])])
如果我检查config.log文件,第一个给了我一个错误:
configure:3837: g++ -c -g -O2 -I/usr/local/include/bamtools conftest.cpp >&5
conftest.cpp:54:23: fatal error: BamReader.h: No such file or directory
compilation terminated.
第二个给了我以下错误:
configure:3837: g++ -c -g -O2 -I/usr/local/include/bamtools/api conftest.cpp >&5
In file included from conftest.cpp:54:0:
/usr/local/include/bamtools/api/BamReader.h:13:28: fatal error: api/api_global.h: No such file or directory
#include "api/api_global.h"^M
^
compilation terminated.
configure:3837: $? = 1
问题在于BamReader.h试图包含api / api_global.h
答案 0 :(得分:0)
我通过将api放入它工作的AC_CHECK_HEADERS中得到了一个简单的修复。
CXXFLAGS="$CXXFLAGS -I/usr/local/include/bamtools"
AC_CHECK_HEADERS([api/BamReader.h], [bamtools_found=yes], [AC_MSG_ERROR([Unable to find bambools header])])
configure output
checking api/BamReader.h usability... yes
基本上,您必须通过将api /附加到每个标头来使用该库。请评论:这是一个好习惯吗?