Building PCL: pcl_kdtree 'to the left of .serialize must have class / struct / union'
I am compiling PCL for Windows 7 with VisualStudio 2013 and I have an error in 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
There is some bug in Serializing a struct containing char * regarding the FLANN library.
I am using major versions from git PCL, Boost 1.57, flann 1.8.1, Visual Studio 2013 x64.
What's wrong with that?
source to share
The decision is related to FLANN itself,
https://github.com/chambbj/osgeo-superbuild/issues/3
need to edit the file serialize.h
at include/flann/util/serialization.h
, on line 92 (if not 92, this is around other declarations BASIC_TYPE_SERIALIZER()
and add
#ifdef _MSC_VER
BASIC_TYPE_SERIALIZER(unsigned __int64);
#endif
resulting in
// 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
source to share