etorth / mir2x

open source MMORPG game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

编译错误

HaroldCC opened this issue · comments

我在WSL1中编译,使用的是gcc12.3版本,编译出错,下面是cmake输出,还请大佬指导一下
` In file included from /mnt/f/Dev/mir2x/common/src/luaf.hpp:10,
[build] from /mnt/f/Dev/mir2x/common/src/luaf.cpp:1:

[build] /mnt/f/Dev/mir2x/common/src/strf.hpp: In instantiation of ‘std::string str_any(const T&) [with T = std::variant<luaf::luaNil, std::unordered_map<luaf::luaVarWrapper, luaf::luaVarWrapper, luaf::_details::_luaVarWrapperHash, std::equal_toluaf::luaVarWrapper, std::allocator<std::pair<const luaf::luaVarWrapper, luaf::luaVarWrapper> > >, long long int, double, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >; std::string = std::__cxx11::basic_string]’:

[build] /mnt/f/Dev/mir2x/common/src/strf.hpp:371:94: required from ‘std::string str_any(const std::vector<T, Args ...>&) [with T = std::variant<luaf::luaNil, std::unordered_map<luaf::luaVarWrapper, luaf::luaVarWrapper, luaf::_details::_luaVarWrapperHash, std::equal_toluaf::luaVarWrapper, std::allocator<std::pair<const luaf::luaVarWrapper, luaf::luaVarWrapper> > >, long long int, double, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >; Args = {std::allocator<std::variant<luaf::luaNil, std::unordered_map<luaf::luaVarWrapper, luaf::luaVarWrapper, luaf::_details::_luaVarWrapperHash, std::equal_toluaf::luaVarWrapper, std::allocator<std::pair<const luaf::luaVarWrapper, luaf::luaVarWrapper> > >, long long int, double, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >}; std::string = std::__cxx11::basic_string]’

[build] /mnt/f/Dev/mir2x/common/src/luaf.cpp:232:25: required from here

[build] /mnt/f/Dev/mir2x/common/src/strf.hpp:348:49: error: no match for ‘operator<<’ (operand types are ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream’} and ‘const std::variant<luaf::luaNil, std::unordered_map<luaf::luaVarWrapper, luaf::luaVarWrapper, luaf::_details::_luaVarWrapperHash, std::equal_toluaf::luaVarWrapper, std::allocator<std::pair<const luaf::luaVarWrapper, luaf::luaVarWrapper> > >, long long int, double, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >’)

[build] 348 | return dynamic_cast<std::stringstream &>(ss << t).str();

[build] | ~~~^~~~
[build] compilation terminated due to -Wfatal-errors.`

commented

fixed, please try latest code.
horrible header including order matters.