Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #3

Closed
victorvadl opened this issue Aug 16, 2023 · 4 comments
Closed

Build error #3

victorvadl opened this issue Aug 16, 2023 · 4 comments

Comments

@victorvadl
Copy link

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_argsfmt::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
Copy link
Author

@ErikasKontenis
Copy link
Owner

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

@ErikasKontenis ErikasKontenis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2023
@victorvadl
Copy link
Author

victorvadl commented Aug 16, 2023

@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
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants