• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compile Issues

bringsz

New Member
Joined
Mar 28, 2015
Messages
18
Reaction score
2
I'm seeing a lot of people having various problems compiling the sources.

I've already followed several tutorials to resolve 'io_service' errors.

I'm using this server.

After adding the /utf-8 command in C/C++ because it was giving a Unicode error, it's now giving this error.

Edit:
Windows 10 - Visual Studio 2019

I've already tried doing that and nothing works.


1764708012465.webp

C++:
1>iomarket.cpp
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2310,45): error C2079: '_' uses undefined struct 'fmt::v12::detail::type_is_unformattable_for<T,char>'
1>        with
1>        [
1>            T=MarketAction_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2283): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<T,0>(const T &,fmt::v12::detail::custom_tag)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketAction_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2283): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<T,0>(const T &,fmt::v12::detail::custom_tag)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketAction_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\format.h(4349): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<MarketAction_t,0>(T &)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketAction_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\format.h(4349): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<MarketAction_t,0>(T &)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketAction_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\Users\Surprise\Desktop\SabrehavenServer-38-introduce-8-0-support\src\iomarket.cpp(26): message : see reference to function template instantiation 'std::string fmt::v12::format<MarketAction_t&,uint16_t&>(fmt::v12::fstring<MarketAction_t &,uint16_t &>,MarketAction_t &,uint16_t &)' being compiled
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2310,45): error C2079: '_' uses undefined struct 'fmt::v12::detail::type_is_unformattable_for<T,char>'
1>        with
1>        [
1>            T=MarketOfferState_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2283): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<T,0>(const T &,fmt::v12::detail::custom_tag)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketOfferState_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\base.h(2283): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<T,0>(const T &,fmt::v12::detail::custom_tag)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketOfferState_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\format.h(4349): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<MarketOfferState_t,0>(T &)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketOfferState_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\format.h(4349): message : see reference to function template instantiation 'fmt::v12::detail::value<Context>::value<MarketOfferState_t,0>(T &)' being compiled
1>        with
1>        [
1>            Context=fmt::v12::context,
1>            T=MarketOfferState_t
1>        ] (compiling source file ..\src\iomarket.cpp)
1>C:\Users\Surprise\Desktop\SabrehavenServer-38-introduce-8-0-support\src\iomarket.cpp(249): message : see reference to function template instantiation 'std::string fmt::v12::format<uint32_t&,MarketAction_t&,uint16_t&,uint16_t&,uint64_t&,time_t&,time_t,MarketOfferState_t&>(fmt::v12::fstring<uint32_t &,MarketAction_t &,uint16_t &,uint16_t &,uint64_t &,time_t &,time_t,MarketOfferState_t &>,uint32_t &,MarketAction_t &,uint16_t &,uint16_t &,uint64_t &,time_t &,time_t &&,MarketOfferState_t &)' being compiled
1>Done building project "theforgottenserver.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
 
Last edited:
SabrehavenServer-38-introduce-8-0-support/src/iomarket.cpp

change all fmt::format("{}", action) to fmt::format("{}", static_cast<int>(action))

and all fmt::format("{}", state)
to fmt::format("{}", static_cast<int>(state))

If this not works change fmt version maybe.



You can also make new file src/fmt_extensions.h

Code:
#pragma once
#include <fmt/format.h>
#include "iomarket.h" // albo gdzie masz MarketAction_t / MarketOfferState_t

template <>
struct fmt::formatter<MarketAction_t> : fmt::formatter<string_view> {
    auto format(MarketAction_t action, fmt::format_context& ctx) {
        string_view name = "UNKNOWN";

        switch(action) {
            case MARKETACTION_BUY:  name = "BUY"; break;
            case MARKETACTION_SELL: name = "SELL"; break;
        }

        return fmt::formatter<string_view>::format(name, ctx);
    }
};

template <>
struct fmt::formatter<MarketOfferState_t> : fmt::formatter<string_view> {
    auto format(MarketOfferState_t state, fmt::format_context& ctx) {
        string_view name = "UNKNOWN";

        switch(state) {
            case OFFERSTATE_ACTIVE:    name = "ACTIVE"; break;
            case OFFERSTATE_CANCELLED: name = "CANCELLED"; break;
            case OFFERSTATE_EXPIRED:   name = "EXPIRED"; break;
        }

        return fmt::formatter<string_view>::format(name, ctx);
    }
};

Then open: iomarket.cpp and add #include "fmt_extensions.h"
 
Back
Top