manatttta
manatttta

Reputation: 3124

Building PCL: pcl_kdtree 'left of .serialize must have class/struct/union'

I am compiling PCL for windows 7 with VisualStudio 2013 and I am having 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 a simmilar error in Serializing struct containing char* concerning the FLANN library.

I am using the head versions from git of PCL, Boost 1.57, flann 1.8.1, Visual Studio 2013 x64.

What is wrong with this?

Upvotes: 4

Views: 2096

Answers (1)

manatttta
manatttta

Reputation: 3124

The solution has to do with FLANN itself,

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

needed to edit the serialize.h file in include/flann/util/serialization.h, in line 92 (if not 92, it is around the other BASIC_TYPE_SERIALIZER()declarations, 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

Upvotes: 15

Related Questions