构建PCL:pcl_kdtree'.serialize的左边必须有class/struct/union'

man*_*tta 3 c++ boost point-cloud-library

我正在使用VisualStudio 2013为Windows 7编译PCL,我遇到错误include/flann/util/serialization.h:

error C2228: left of '.serialize' must have class/struct/union  D:\Libs\PCL\flann\include\flann\util\serialization.h    18  1   pcl_kdtree
Run Code Online (Sandbox Code Playgroud)

Serializing包含有关FLANN库的char*的结构中存在类似错误 .

我正在使用PCL的git,Boost 1.57,flann 1.8.1,Visual Studio 2013 x64的头版本.

这有什么问题?

man*_*tta 13

解决方案与FLANN本身有关,

https://github.com/chambbj/osgeo-superbuild/issues/3

需要编辑serialize.h文件include/flann/util/serialization.h,在第92行(如果不是92,它是围绕其他BASIC_TYPE_SERIALIZER()声明,并添加

#ifdef _MSC_VER
BASIC_TYPE_SERIALIZER(unsigned __int64);
#endif
Run Code Online (Sandbox Code Playgroud)

导致

// declare serializers for simple types
BASIC_TYPE_SERIALIZER(char);
BASIC_TYPE_SERIALIZER(unsigned char);
BASIC_TYPE_SERIALIZER(short);
BASIC_TYPE_SERIALIZER(unsigned short);
BASIC_TYPE_SERIALIZER(int);
BASIC_TYPE_SERIALIZER(unsigned int);
BASIC_TYPE_SERIALIZER(long);
BASIC_TYPE_SERIALIZER(unsigned long);
BASIC_TYPE_SERIALIZER(float);
BASIC_TYPE_SERIALIZER(double);
BASIC_TYPE_SERIALIZER(bool);
#ifdef _MSC_VER
BASIC_TYPE_SERIALIZER(unsigned __int64);
#endif
Run Code Online (Sandbox Code Playgroud)