C++ boost图中的错误

C++ boost图中的错误,c++,boost,point-cloud-library,boost-graph,C++,Boost,Point Cloud Library,Boost Graph,我正在使用PCL库,在内部它需要boost库 不幸的是,我遇到了这样的错误。明确地说,我没有提到任何boost库,但是PCL库提到了 /usr/include/boost/graph/graph_concepts.hpp: In destructor ‘boost::concepts::AdjacencyMatrix<G>::~AdjacencyMatrix()’: /usr/include/boost/graph/graph_concepts.hpp:368:17: error:

我正在使用PCL库,在内部它需要boost库

不幸的是,我遇到了这样的错误。明确地说,我没有提到任何boost库,但是PCL库提到了

/usr/include/boost/graph/graph_concepts.hpp: In destructor ‘boost::concepts::AdjacencyMatrix<G>::~AdjacencyMatrix()’:
/usr/include/boost/graph/graph_concepts.hpp:368:17: error: missing template arguments before ‘(’ token
/usr/include/boost/graph/graph_concepts.hpp: In member function ‘void boost::concepts::AdjacencyMatrix<G>::const_constraints(const G&)’:
/usr/include/boost/graph/graph_concepts.hpp:372:17: error: missing template arguments before ‘(’ token
/usr/include/boost/graph/graph_concepts.hpp:在析构函数“boost::concepts::AdjacencyMatrix::~AdjacencyMatrix()”中:
/usr/include/boost/graph/graph_concepts.hpp:368:17:错误:在“(”标记之前缺少模板参数
/usr/include/boost/graph/graph_concepts.hpp:在成员函数“void boost::concepts::AdjacencyMatrix::const_约束(const G&)”中:
/usr/include/boost/graph/graph_concepts.hpp:372:17:错误:在“(”标记之前缺少模板参数
无法复制它

以下是我所做的:

  • ubuntu 13.10
  • 内核3.11.0-20-generic#34 Ubuntu SMP x86_64
  • sudo-apt-get-install-libegen3-dev-libflann-dev-libboost-all-dev-cmake-build-sential
  • 下载
汇编花了一些时间

cd /tmp
tar xf ~/Downloads/pcl-pcl-1.7.1.tar.gz 
cd pcl-pcl-1.7.1/
cmake .
time make -sj
输出以

...
Linking CXX executable ../bin/pcl_train_linemod_template
[100%] Built target pcl_train_linemod_template

real    13m55.327s
user    82m49.499s
sys 2m24.611s
非常令人印象深刻。但显然没有编译错误()。我希望您能找出不同之处。

这很奇怪

当我移动头文件时,问题就解决了

#包括


到所有头文件的开头。再也没有错误了,执行的程序给出了预期的结果!

最有可能的是,您的一个程序头文件有一些
#define ZZZ
语句,并且该宏ZZZ与Boost中的某个标识符冲突。这就是为什么将
icp.h
移动到第一个头文件时问题消失的原因线路


要找出是哪个宏导致了问题,请仔细查看您指定的行:
/usr/include/boost/graph/graph\u concepts.hpp:368
。宏可能会替换或删除此行或其附近的一个标识符。祝您好运。

此外,您应该显示引用的行。我收集点云库。它是takin在我的机器上编译一段时间(它只是一个32GiB的四重HT i7)。完成后请告知。点云库编译时没有任何错误。但当我在程序中使用头pcl/registration/icp.h时,问题中显示的错误会突然出现。当我使用其他头文件时没有错误……我有可能是因为boost库而出错?@Sal为什么你/没有在你的文章中提到/这一点r问题o.OGood find。请向PCL的开发人员报告:)我刚刚完成了一次成功的编译,包括
icp.h
,我以前遇到过类似的问题。它们通常是由于忘记在自定义创建的类标题中添加分号。在向开发人员发送邮件之前,我会仔细检查您的任何标题。我想一想。