ErikasKontenis / SabrehavenServer

15 stars 34 forks source link

Build error #3

Closed victorvadl closed 1 year ago

victorvadl commented 1 year ago

Im having this issue when try build:

iomarket.cpp 1> C:\vcpkg-master\installed\x64-windows\include\fmt\core.h(1691,7): error C2338: static_assert failed: 'Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt' (compilando arquivo de origem ..\src\iomarket.cpp) 1> C:\vcpkg-master\installed\x64-windows\include\fmt\core.h(1711,10): message : consulte a referência à instanciação 'fmt::v10::detail::value fmt::v10::detail::make_value<Context,MarketAction_t&>(T)' do modelo que está sendo compilada 1> with 1> [ 1> Context=fmt::v10::format_context, 1> T=MarketAction_t & 1> ] (compilando arquivo de origem ..\src\iomarket.cpp) 1> C:\vcpkg-master\installed\x64-windows\include\fmt\core.h(1825,23): message : consulte a referência à instanciação 'fmt::v10::detail::value fmt::v10::detail::make_arg<true,Context,fmt::v10::detail::type::custom_type,MarketAction_t&,0>(T)' do modelo que está sendo compilada 1> with 1> [ 1> Context=fmt::v10::format_context, 1> T=MarketAction_t & 1> ] (compilando arquivo de origem ..\src\iomarket.cpp) 1> C:\vcpkg-master\installed\x64-windows\include\fmt\core.h(1844,3): message : consulte a referência à instanciação 'fmt::v10::format_arg_store<fmt::v10::format_context,MarketAction_t,unsigned short>::format_arg_store<MarketAction_t&,uint16_t&>(MarketAction_t &,uint16_t &)' do modelo que está sendo compilada (compilando arquivo de origem ..\src\iomarket.cpp) 1> C:\vcpkg-master\installed\x64-windows\include\fmt\core.h(2817,28): message : consulte a referência à instanciação 'fmt::v10::format_arg_store<fmt::v10::format_context,MarketAction_t,unsigned short> fmt::v10::make_format_args<fmt::v10::format_context,MarketAction_t&,uint16_t&>(MarketAction_t &,uint16_t &)' do modelo que está sendo compilada (compilando arquivo de origem ..\src\iomarket.cpp) 1> D:\OT Tibia\Xenon_Mix\src\iomarket.cpp(26,65): message : consulte a referência à instanciação 'std::string fmt::v10::format<MarketAction_t&,uint16_t&>(fmt::v10::basic_format_string<char,MarketAction_t &,uint16_t &>,MarketAction_t &,uint16_t &)' do modelo que está sendo compilada 1>Destino de compilação pronto "ClCompile" no projeto "theforgottenserver.vcxproj" -- FALHA.

Can you please help me?

victorvadl commented 1 year ago

@ErikasKontenis @tarantonio @danilopucci

ErikasKontenis commented 1 year ago

Fmt made breaking changes. You either download fmt 9.0 or apply latest changes from tfs https://github.com/otland/forgottenserver/blob/283c5405d0fc6e3dc346ec3f64d0423f9ec3ba1f/src/tools.h#L79

victorvadl commented 1 year ago

@ErikasKontenis Do u know how can I install fmt 9.0 from vcpkg? Or can you help me with applying latest changes from tfs? idk if should I apply in tools.h or in iomarket.cpp or in core.h where the error is point to this:

'template <typename Context, typename T> FMT_CONSTEXPR FMT_INLINE auto make_value(T&& val) -> value { auto&& arg = arg_mapper().map(FMT_FORWARD(val)); using arg_type = remove_cvref_t<decltype(arg)>;

constexpr bool formattable_char = !std::is_same<arg_type, unformattable_char>::value; static_assert(formattable_char, "Mixing character types is disallowed.");

// Formatting of arbitrary pointers is disallowed. If you want to format a // pointer cast it to void* or const void*. In particular, this forbids // formatting of [const] volatile char* printed as bool by iostreams. constexpr bool formattable_pointer = !std::is_same<arg_type, unformattable_pointer>::value; static_assert(formattable_pointer, "Formatting of non-void pointers is disallowed.");

constexpr bool formattable = !std::is_same<arg_type, unformattable>::value; static_assert( formattable, "Cannot format an argument. To make type T formattable provide a " "formatter specialization: https://fmt.dev/latest/api.html#udt"); return {arg}; }'

victorvadl commented 1 year ago

@ErikasKontenis I have installer fmt 9.0 but now I'm facing another issue:

Severity Code Description Project File Line Suppression Status Error LNK2001 unresolved external symbol "class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl fmt::v9:: vformat(class fmt::v9::basic_string_view,class fmt::v9::basic_format_args<class fmt::v9::basic_format_context<class fmt::v9::appender,char> >)" (? vformat@v9@fmt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string_view@D@12@V?$basic_format_args@V? $basic_format_context@Vappender@v9@fmt@@D@v9@fmt@@12@@Z) theforgottenserver D:\OT Tibia\Xenon_Mix\vc14\iologindata.obj 1