C++ 23 Module Support #4998
ToddThomson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thank-you for this C++ json project. It truly is a needed component.
I wanted to share an issue that I had today with a c++23 modules based project. I used:
CPMAddPackage( NAME nlohmann_json VERSION 3.12.0 GITHUB_REPOSITORY nlohmann/json OPTIONS "JSON_BuildTests OFF" "JSON_Install OFF" "JSON_MultipleHeaders OFF" )to add the package to my project.
I found that using the json package with VS2026 in a module file ( .ixx ) by including the json.hpp I could not get any json API calls to compile.
After reviewing the issues I found that the dev branch had a fix for the issue. Thank-you to all involved!
To resolve the issue ( before the next release comes out ) you can simply add the latest json.hpp as a 3rdparty dependency and then add the json.cppm ( which I renamed to json.ixx ) to your module source files. After that just import the module!
import nlohmann.json;I hope that helps out anyone with a similar issue.
Beta Was this translation helpful? Give feedback.
All reactions