gpt4 book ai didi

c++ - 建筑 PCL : pcl_kdtree 'left of .serialize must have class/struct/union'

转载 作者:太空狗 更新时间:2023-10-29 19:43:26 28 4
gpt4 key购买 nike

我正在使用 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com