我正在使用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
有一个类似的错误 关于FLANN图书馆的Serializing struct containing char*。
我使用的是PCL的git,Boost 1.57,flann 1.8.1,Visual Studio 2013 x64的头版本。
这有什么问题?
答案 0 :(得分: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
导致
// 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