C++ 从\u启用\u共享\u此派生类方法是未定义的引用

C++ 从\u启用\u共享\u此派生类方法是未定义的引用,c++,shared-ptr,C++,Shared Ptr,我正在使用apache的库(单击链接查看有问题的文件)。第82行定义了从std::enable_shared_from_this继承的类RowGroupStatistics,第132行定义了从RowGroupStatistics继承的类TypedRowGroupStatistics 在我的代码中,我只有: shared_ptr<RowGroupStatistics> stats = ...; shared_ptr<Int32Statistics> stats2 = sta

我正在使用apache的库(单击链接查看有问题的文件)。第82行定义了从std::enable_shared_from_this继承的类RowGroupStatistics,第132行定义了从RowGroupStatistics继承的类TypedRowGroupStatistics

在我的代码中,我只有:

shared_ptr<RowGroupStatistics> stats = ...;
shared_ptr<Int32Statistics> stats2 = static_pointer_cast<Int32Statistics>(ccm.statistics());
我得到一个编译错误:

undefined reference to `parquet::TypedRowGroupStatistics<parquet::DataType<(parquet::Type::type)1> >::min() const'
collect2: error: ld returned 1 exit status
对'parquet::TypedRowGroupStatistics::min()const'的未定义引用
collect2:错误:ld返回了1个退出状态

我猜我使用的enable_shared_from_这个功能是错误的,但我不知道将基指针强制转换到派生类并使用其方法的正确方法是什么。

这是链接器错误,您的代码没有问题。我猜你没有在链接器搜索路径中包含拼花cpp的LIB。我的意思是我在代码中使用了几乎所有的拼花cpp功能。我设法使用库读取文件,并读取元数据以打印标题信息。但我唯一无法在标题中打印的是这些统计数据,因为存在编译问题。你曾经解决过这个问题吗?我想我解决过,但我不再在那家公司工作了,我不记得我做了什么。抱歉,这是链接器错误,你的代码没有问题。我猜你没有在链接器搜索路径中包含拼花cpp的LIB。我的意思是我在代码中使用了几乎所有的拼花cpp功能。我设法使用库读取文件,并读取元数据以打印标题信息。但我唯一无法在标题中打印的是这些统计数据,因为存在编译问题。你曾经解决过这个问题吗?我想我解决过,但我不再在那家公司工作了,我不记得我做了什么。很抱歉
undefined reference to `parquet::TypedRowGroupStatistics<parquet::DataType<(parquet::Type::type)1> >::min() const'
collect2: error: ld returned 1 exit status