LoginSignup
0
0

More than 3 years have passed since last update.

clang-cl で C++11 or later で RapidJSON 1.1(2016-8-25) をコンパイルするメモ

Posted at

clang-cl で C++11 or later で RapidJSON 1.1(2016-8-25) をコンパイルしようとすると, コンパイルエラーがでます.

rror: calling a private constructor of class 'rapidjson::GenericValue<rapidjson::UTF8<>>' など.

RAPIDJSON_HAS_CXX11_RVALUE_REFS の定義がうまくいっていないためです.

とりあえずは RAPIDJSON_HAS_CXX11_RVALUE_REFS を明示的に定義してあげればいけます.

CMake ですと以下のようになるでしょうか.

if (MSVC AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
  target_compile_definitions(${TARGET} PUBLIC RAPIDJSON_HAS_CXX11_RVALUE_REFS)
endif ()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0