Linking the module #4983
Unanswered
SamG101-Developer
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Are you using the latest We there have a test with the following CMake file: cmake_minimum_required(VERSION 3.28)
project(json_test CXX)
set(NLOHMANN_JSON_BUILD_MODULES ON CACHE BOOL "Enable nlohmann.json module support")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CURRENT_BINARY_DIR}/tests)
add_executable(json_test main.cpp)
target_link_libraries(json_test
PRIVATE
nlohmann_json_modules
)
target_compile_definitions(json_test
PRIVATE NLOHMANN_JSON_BUILD_MODULES
)
target_compile_features(json_test PUBLIC cxx_std_20)That works with GCC. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I am on the latest edition of
I have a Also just tried |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I am using GCC 15.2, and have built the package with modules, and see the message
-- Building nlohmann.json C++ modulein the console. I link it to my project in cmake using:yet GCC can't find the module when I do
import nlohmann.json. Is there any additional cmake things I need to do to fix the linking? Thanks.Beta Was this translation helpful? Give feedback.
All reactions