作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用 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
有一个类似的错误 Serializing struct containing char*关于 FLANN 库。
我使用的是来自 PCL 的 git、Boost 1.57、flann 1.8.1、Visual Studio 2013 x64 的 head 版本。
这有什么问题吗?
最佳答案
解决方案与 FLANN 本身有关,
https://github.com/chambbj/osgeo-superbuild/issues/3
需要编辑include/flann/util/serialization.h
中的serialize.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
关于c++ - 建筑 PCL : pcl_kdtree 'left of .serialize must have class/struct/union' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27424343/
我正在使用 VisualStudio 2013 为 Windows 7 编译 PCL,但我在 include/flann/util/serialization.h 中遇到错误: error C2228
我是一名优秀的程序员,十分优秀!