• 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!

TFS 1.X+ Errors when compiling TFS v1.4x (v1.4, v1.4.1, v1.4.2)

Epsilons

Member
Joined
Apr 5, 2024
Messages
8
Solutions
1
Reaction score
8
GitHub
EpsilonsQc
Dear OTLand community,

I'm reaching out for assistance regarding issues I'm encountering while attempting to compile TFS v1.4.2. I have the exact same errors with TFS v1.4 and v1.4.1. That being said, I compiled TFS v1.2 and TFS v1.5 with no problem whatsoever.

Here's the errors Visual Studio throw:

C++:
Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=AccessList_t
        ]    theforgottenserver    .\vcpkg\installed\x64-windows\include\fmt\core.h    1600    


Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=MarketAction_t
        ]    theforgottenserver    .\vcpkg\installed\x64-windows\include\fmt\core.h    1600    


Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=MarketOfferState_t
        ]    theforgottenserver    .\vcpkg\installed\x64-windows\include\fmt\core.h    1600    


Error    C2338    static_assert failed: 'Cannot format an argument. To make type T formattable provide a formatter<T>
specialization: https://fmt.dev/latest/api.html#udt' 
theforgottenserver    .\vcpkg\installed\x64-windows\include\fmt\core.h    1604

Looking forward to any assistance you can provide.
 
Last edited:
Solution
Thanks, the alternative solution worked and now TFS v1.4.2 is compiling flawlessly.

I applied the change to iomapserialize.cpp and iomarket.cpp while making sure to cast all the enums to int static_cast<int> (instead of tfs::to_underlying).

I've attached the modified iomapserialize.cpp and iomarket.cpp in a zip archive here to make it simpler for dev who might stumble across this issue in the future.
I did that (applied the iomapserialize.cpp, iomarket.cpp and tools.h changes) and it's not working. Throw 295 errors now.

I believe my original issue lie within the fmt lib. I tried to override the more recent version installed with vcpkg back to v9.0.0 (which is the version that was available at the time TFS v1.4.2 was released) with no success.
 
Last edited:
Yes, the issue is related to fmt library (since v10~)

You can see here that indeed the issue is related to the enums (implicit conversion), iomarket.cpp in this case
Code:
Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=MarketOfferState_t
        ]    theforgottenserver    .\vcpkg\installed\x64-windows\include\fmt\core.h    1600

You can also try the alternative solution.
 
Thanks, the alternative solution worked and now TFS v1.4.2 is compiling flawlessly.

I applied the change to iomapserialize.cpp and iomarket.cpp while making sure to cast all the enums to int static_cast<int> (instead of tfs::to_underlying).

I've attached the modified iomapserialize.cpp and iomarket.cpp in a zip archive here to make it simpler for dev who might stumble across this issue in the future.
 

Attachments

  • TFS-v1.4.2-fix-compilation-errors.zip
    5.5 KB · Views: 26 · VirusTotal
Last edited:
Solution
Back
Top