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 fail in MinGW #217

Closed
smpn2 opened this issue Aug 22, 2024 · 3 comments
Closed

Build fail in MinGW #217

smpn2 opened this issue Aug 22, 2024 · 3 comments
Labels
bug Something isn't working compile

Comments

@smpn2
Copy link

smpn2 commented Aug 22, 2024

Of course, I understand that it is better to build it in an Docker environment, but because of RapidJSON, it cannot be built with the latest MinGW toolchain.

Please apply this patch or update libs.

diff --git a/external/rapidjson/document.h b/external/rapidjson/document.h
index 151f5de..12a98ee 100644
--- a/external/rapidjson/document.h
+++ b/external/rapidjson/document.h
@@ -329,7 +329,7 @@ struct GenericStringRef {
     operator const Ch *() const { return s; }
 
     const Ch* const s; //!< plain CharType pointer
-    const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
+    unsigned int length; //!< length of the string (excluding the trailing NULL terminator)
 
 private:
     //! Disallow construction from non-const array

Step by reproduce:

  • Install MSYS2
  • $ pacman -Syu
  • $ pacman -S mingw-w64-x86_64-toolchain mingw-w64-i686-toolchain
  • Open CLion and configure toolchain.
  • Build
@smpn2 smpn2 added the bug Something isn't working label Aug 22, 2024
@sp2xdev
Copy link
Contributor

sp2xdev commented Aug 23, 2024

This needs a better fix than modifying the library (which hasn't been updated since 2016) - see the code around RAPIDJSON_NO_SIZETYPEDEFINE in the rapidjson.

@smpn2
Copy link
Author

smpn2 commented Aug 23, 2024

@sp2xdev
Yes. I understand that patching the library is a last resort.
It seems to be a bug. Tencent/rapidjson#2277

I thought it would be smart to update RapidJSON to the latest (https://github.com/Tencent/rapidjson/tree/7c73dd7de7c4f14379b781418c6e947ad464c818) version.

Changes-On-56ac55.patch

@sp2xdev
Copy link
Contributor

sp2xdev commented Aug 24, 2024

I can integrate Tencent/rapidjson#719 soon which is the actual fix in rapidjson.

@sp2xdev sp2xdev closed this as completed Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compile
Projects
None yet
Development

No branches or pull requests

2 participants