错误信息如下:
In file included from /home/yangfan/Dev/Piccolo-YF/engine/source/runtime/core/meta/reflection/reflection_register.cpp:6:
/home/yangfan/Dev/Piccolo-YF/engine/source/runtime/core/meta/serializer/serializer.h: In instantiation of ‘static Json Piccolo::Serializer::write(const T&) [with T = std::vector<Piccolo::ObjectInstanceRes>; Json = json11::Json]’:
/home/yangfan/Dev/Piccolo-YF/engine/source/_generated/serializer/all_serializer.ipp:48:66: required from here
/home/yangfan/Dev/Piccolo-YF/engine/source/runtime/core/meta/serializer/serializer.h:67:31: error: static assertion failed: Serializer::write<T> has not been implemented yet!
67 | static_assert(always_false<T>, "Serializer::write<T> has not been implemented yet!");
serializer.h第67行所在的函数:
template<typename T>
static Json write(const T& instance)
{
if constexpr (std::is_pointer<T>::value)
{
return writePointer((T)instance);
}
else
{
static_assert(always_false<T>, "Serializer::write<T> has not been implemented yet!");
return Json();
}
}
看样子是if中的“std::is_pointer<T>::value”为false,执行了断言的那个分支。但我是C++萌新,不太明白为什么会为false,毫无头绪求大佬们赐教。
在windows上能编译通过,最近在捣鼓Linux,试着在Ubuntu上编译下就出现了这个问题。已经按照网上的C++环境教程安装了最新版本的gcc g++等编译器和库,查了下编译器是支持c++17的。也按照Piccolo的Readme安装了相关的包。使用"Release"配置编译。