SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
[5분 따라하기]
비주얼 스튜디오 C++에서 JSON
파서 설치하기
박재호(jrogue@gmail.com)
참고 자료
• <컴퓨터 vs 책> 블로그
• http://jhrogue.blogspot.com/
• OKdevTV 유튜브 방송
• 오늘자 방송
• https://www.youtube.com/watch?v=KH3mirEkZKU&list=PLdntWJk2tJPLKNNYBVCxn
de2PEB6dzbSL&index=14
• 5분 따라하기 리스트:
• https://www.youtube.com/playlist?list=PLdntWJk2tJPLKNNYBVCxnde2PEB6dzbSL
• 슬라이드 셰어
• https://www.slideshare.net/jrogue/presentations
• ASCIINEMA
• https://asciinema.org/~jrogue
선행 조건
• Visual Studio에 영문 언어팩 설치
오늘 소개할 내용
• 자바스크립트와 파이썬과는 달리 C/++에서는 JSON을 언어 차
원에서 지원하지 않음
• 이런 상황에서 비주얼 스튜디오에서 C++ 프로그램을 개발할
때 어떻게 해야할까?
패키지로 설치하는 방법
• vcpkg!
• https://docs.microsoft.com/ko-kr/cpp/build/vcpkg?view=vs-2019
• C++용 명령행 패키지 관리자
• 교차 플랫폼 지원: 윈도우, 리눅스, MacOS X
• 윈도우 카탈로그에 등록된 경우 소스 코드를 다운로드해서 빌드 → 컴
파일러 버전 문제 해소
설치
• $ git clone https://github.com/Microsoft/vcpkg.git
• $ cd vcpkg
• $ ./bootstrap-vcpkg.sh
• $ ./vcpkg integrate install
• $ ./vcpkg search | grep json
• $ ./vcpkg install nlohmann-json
실행 결과(예시)
$ git clone https://github.com/Microsoft/vcpkg.git
Cloning into 'vcpkg'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 86762 (delta 0), reused 0 (delta 0), pack-reused
86761
Receiving objects: 100% (86762/86762), 25.61 MiB | 8.41 MiB/s,
done.
Resolving deltas: 100% (53902/53902), done.
Updating files: 100% (5288/5288), done.
$ ./bootstrap-vcpkg.sh
Building vcpkg.exe ...
pch.cpp
archives.cpp
checks.cpp
chrono.cpp
...
vcpkgpaths.cpp
versiont.cpp
visualstudio.cpp
vcpkg.cpp
...
Building vcpkg.exe... done.
$ ./vcpkg integrate install
Applied user-wide integration for this vcpkg root.
All MSBuild C++ projects can now #include any installed libraries.
Linking will be handled automatically.
Installing new libraries will make them instantly available.
CMake projects should use: "-
DCMAKE_TOOLCHAIN_FILE=C:/Users/jaypark/vcpkg/scripts/buildsystems/vcpkg.
cmake"
실행 결과(예시)
$ ./vcpkg search | grep json
arrow[json] JSON file support
bitserializer[cpprestjson-archive] Module for support JSON (implementation based on the CppRestSDK library)
bitserializer[rapidjson-archive] Module for support JSON (implementation based on the RapidJson library)
bitserializer-cpp... alias Deprecated alias for bitserializer-cpprestjson
bitserializer-rap... alias Deprecated alias for bitserializer-rapidjson
cjson 2019-11-30-1 Ultralightweight JSON parser in ANSI C
cjson[utils] Enable building the cJSON_Utils library
json-c 2019-09-10 A JSON implementation in C
json-dto 0.2.9.2 A small header-only library for converting data between json representation an...
json-schema-valid... 2.1.0 This is a C++ library for validating JSON documents based on a JSON Schema. Th...
json-spirit 4.1.0-1 json parser using boost library
json11 2017-06-20-2 json11 is a tiny JSON library for C++11, providing JSON parsing and serializat...
json5-parser 1.0.0-1 An enhancement of the JSON Spirit C++ library to understand json5.
jsoncons 0.155.1 A C++, header-only library for constructing JSON and JSON-like text and binary...
jsoncpp 1.9.2 jsoncpp is an implementation of a JSON reader and writer in C++. JSON (JavaScr...
jsonnet 0.14.0-1 Jsonnet - The data templating language
jwt-cpp 0.4.0 A header only library for creating and validating json web tokens in c++
nlohmann-json 3.9.1 JSON for Modern C++
parson 2019-07-11 a lighweight json library written in C
picojson 1.3.0-1 A header-file-only, JSON parser serializer in C++.
rapidjson 2020-02-08 A fast JSON parser/generator for C++ with both SAX/DOM style API <http://rapid...
sajson 2018-09-21 Lightweight, extremely high-performance JSON parser for C++11
simdjson 0.4.6 A extremely fast JSON library that can parse gigabytes of JSON per second
sqlite3[json1] enable JSON functionality for sqlite3
taocpp-json 2019-07-11 C++ header-only JSON library
valijson 2018-11-17-1 Header-only C++ library for JSON Schema validation
실행 결과(예시)
$ ./vcpkg install nlohmann-json
Computing installation plan...
A suitable version of cmake was not found (required v3.17.2). Downloading portable cmake v3.17.2...
Downloading cmake...
https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.zip ->
C:Usersjayparkdocumentsvcpkgdownloadscmake-3.17.2-win32-x86.zip
Extracting cmake...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:Usersjayparkdocumentsvcpkgdownloads7-
zip.commandline.18.1.0.nupkg
Extracting 7zip...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> C:Usersjayparkdocumentsvcpkgdownloads22ea847d-nuget.exe
The following packages will be built and installed:
nlohmann-json[core]:x86-windows
Detecting compiler hash for triplet x86-windows...
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Downloading powershell-core...
https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip ->
C:UsersjayparkvcpkgdownloadsPowerShell-6.2.1-win-x86.zip
Extracting powershell-core...
실행 결과(예시)
Starting package 1/1: nlohmann-json:x86-windows
Building package nlohmann-json[core]:x86-windows...
Could not locate cached archive:
C:UsersjayparkAppDataLocalvcpkg/archives1e1e699d54ec05be35d7ea0e7c4de7a1672bd0b286.zip
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/CMakeLists.txt...
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/LICENSE.MIT...
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/nlohmann_json.natvis...
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/config.cmake.in...
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/pkg-config.pc.in...
-- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/nlohmann_jsonConfigVersion.cmake.in...
-- Downloading https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip...
-- Extracting source C:/Users/jaypark/documents/vcpkg/downloads/nlohmann-json-v3.9.1-include.zip
-- Using source at C:/Users/jaypark/documents/vcpkg/buildtrees/nlohmann-json/3.9.1-74ced61d52.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Users/jaypark/documents/vcpkg/packages/nlohmann-json_x86-windows/share/nlohmann-json/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:UsersjayparkAppDataLocalvcpkg/archives1e1e699d54ec05be35d7ea0e7c4de7a1672bd0b286.zip
Building package nlohmann-json[core]:x86-windows... done
Installing package nlohmann-json[core]:x86-windows...
Installing package nlohmann-json[core]:x86-windows... done
Elapsed time for package nlohmann-json:x86-windows: 12.56 s
Total elapsed time: 30.43 s
The package nlohmann-json:x86-windows provides CMake targets:
find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(main PRIVATE nlohmann_json nlohmann_json::nlohmann_json)
실제 사용(예시)
#include <nlohmann/json.hpp>
using nlohmann::json;
json j1 = json::parse(json_string); // 파싱
// 1st class data type
json j2 = {
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{"answer", {
{"everything", 42}
}},
{"list", {1, 0, 2}},
{"object", {
{"currency", "USD"},
{"value", 42.99}
}}
};
json j3 = "{ "happy": true, "pi": 3.141 }"_json; // serialize

Weitere ähnliche Inhalte

Was ist angesagt?

전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
devCAT Studio, NEXON
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
min woog kim
 
임태현, MMO 서버 개발 포스트 모템, NDC2012
임태현, MMO 서버 개발 포스트 모템, NDC2012임태현, MMO 서버 개발 포스트 모템, NDC2012
임태현, MMO 서버 개발 포스트 모템, NDC2012
devCAT Studio, NEXON
 
TCP가 실패하는 상황들
TCP가 실패하는 상황들TCP가 실패하는 상황들
TCP가 실패하는 상황들
ssuser7c5a40
 

Was ist angesagt? (20)

NDC12_Lockless게임서버설계와구현
NDC12_Lockless게임서버설계와구현NDC12_Lockless게임서버설계와구현
NDC12_Lockless게임서버설계와구현
 
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
Spark + S3 + R3를 이용한 데이터 분석 시스템 만들기
 
React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작
 
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
 
임태현, MMO 서버 개발 포스트 모템, NDC2012
임태현, MMO 서버 개발 포스트 모템, NDC2012임태현, MMO 서버 개발 포스트 모템, NDC2012
임태현, MMO 서버 개발 포스트 모템, NDC2012
 
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 3.6.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 3.6.0対応)FIWARE Orion Context Broker コンテキスト情報管理 (Orion 3.6.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 3.6.0対応)
 
게임서버프로그래밍 #2 - IOCP Adv
게임서버프로그래밍 #2 - IOCP Adv게임서버프로그래밍 #2 - IOCP Adv
게임서버프로그래밍 #2 - IOCP Adv
 
[サーベイ論文] Deep Learningを用いた歩行者検出の研究動向
[サーベイ論文] Deep Learningを用いた歩行者検出の研究動向[サーベイ論文] Deep Learningを用いた歩行者検出の研究動向
[サーベイ論文] Deep Learningを用いた歩行者検出の研究動向
 
공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반
 
TCP가 실패하는 상황들
TCP가 실패하는 상황들TCP가 실패하는 상황들
TCP가 실패하는 상황들
 
Docker入門 - 基礎編 いまから始めるDocker管理
Docker入門 - 基礎編 いまから始めるDocker管理Docker入門 - 基礎編 いまから始めるDocker管理
Docker入門 - 基礎編 いまから始めるDocker管理
 
Iocp 기본 구조 이해
Iocp 기본 구조 이해Iocp 기본 구조 이해
Iocp 기본 구조 이해
 
자습해도 모르겠던 딥러닝, 머리속에 인스톨 시켜드립니다.
자습해도 모르겠던 딥러닝, 머리속에 인스톨 시켜드립니다.자습해도 모르겠던 딥러닝, 머리속에 인스톨 시켜드립니다.
자습해도 모르겠던 딥러닝, 머리속에 인스톨 시켜드립니다.
 
[2013 CodeEngn Conference 08] pwn3r - Pwning multiplayer game - case Starcraf...
[2013 CodeEngn Conference 08] pwn3r - Pwning multiplayer game - case Starcraf...[2013 CodeEngn Conference 08] pwn3r - Pwning multiplayer game - case Starcraf...
[2013 CodeEngn Conference 08] pwn3r - Pwning multiplayer game - case Starcraf...
 
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
 
深層学習を用いたコンピュータビジョン技術と運転行動モニタリングへの応用
深層学習を用いたコンピュータビジョン技術と運転行動モニタリングへの応用深層学習を用いたコンピュータビジョン技術と運転行動モニタリングへの応用
深層学習を用いたコンピュータビジョン技術と運転行動モニタリングへの応用
 
NVIDIA Seminar ディープラーニングによる画像認識と応用事例
NVIDIA Seminar ディープラーニングによる画像認識と応用事例NVIDIA Seminar ディープラーニングによる画像認識と応用事例
NVIDIA Seminar ディープラーニングによる画像認識と応用事例
 
Laravel로 스타트업 기술 스택 구성하기
Laravel로 스타트업 기술 스택 구성하기Laravel로 스타트업 기술 스택 구성하기
Laravel로 스타트업 기술 스택 구성하기
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 

Ähnlich wie [5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기

The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
Oleg Podsechin
 

Ähnlich wie [5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기 (20)

Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
 
Rust & Python : Python WA October meetup
Rust & Python : Python WA October meetupRust & Python : Python WA October meetup
Rust & Python : Python WA October meetup
 
Readme
ReadmeReadme
Readme
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
Modern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettextModern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettext
 
Using PnP JS Core in Node.js
Using PnP JS Core in Node.jsUsing PnP JS Core in Node.js
Using PnP JS Core in Node.js
 
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderA Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
 
Heroku pycon
Heroku pyconHeroku pycon
Heroku pycon
 
Новый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоныНовый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоны
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
The Heron Mapping Client - Overview, Functions, Concepts
The Heron Mapping Client - Overview, Functions, Concepts The Heron Mapping Client - Overview, Functions, Concepts
The Heron Mapping Client - Overview, Functions, Concepts
 

Mehr von Jay Park

Mehr von Jay Park (20)

(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
 
(독서광) 쉽고 빠르게 익히는 실전 LLM - ChatGPT 활용부터 LLM 파인튜닝, 임베딩, 고급 프롬프트 엔지니어링까지
(독서광) 쉽고 빠르게 익히는 실전 LLM - ChatGPT 활용부터 LLM 파인튜닝, 임베딩, 고급 프롬프트 엔지니어링까지(독서광) 쉽고 빠르게 익히는 실전 LLM - ChatGPT 활용부터 LLM 파인튜닝, 임베딩, 고급 프롬프트 엔지니어링까지
(독서광) 쉽고 빠르게 익히는 실전 LLM - ChatGPT 활용부터 LLM 파인튜닝, 임베딩, 고급 프롬프트 엔지니어링까지
 
(독서광) LEAN HR - 당신의 스타트업은 안녕하십니까 (한빛미디어 2024)
(독서광) LEAN HR - 당신의 스타트업은 안녕하십니까 (한빛미디어 2024)(독서광) LEAN HR - 당신의 스타트업은 안녕하십니까 (한빛미디어 2024)
(독서광) LEAN HR - 당신의 스타트업은 안녕하십니까 (한빛미디어 2024)
 
(독서광) 구술 문화와 문자 문화: 출간 30주년 기념판 (전후 해제 포함)
(독서광) 구술 문화와 문자 문화: 출간 30주년 기념판 (전후 해제 포함)(독서광) 구술 문화와 문자 문화: 출간 30주년 기념판 (전후 해제 포함)
(독서광) 구술 문화와 문자 문화: 출간 30주년 기념판 (전후 해제 포함)
 
(독서광) 테드 창의 숨 (아홉 가지 단편/중편 SF 과학 소설 모음집)
(독서광) 테드 창의 숨 (아홉 가지 단편/중편 SF 과학 소설 모음집)(독서광) 테드 창의 숨 (아홉 가지 단편/중편 SF 과학 소설 모음집)
(독서광) 테드 창의 숨 (아홉 가지 단편/중편 SF 과학 소설 모음집)
 
(독서광) 이제는 이기는 인생을 살고 싶다 - 적을 만들지 않고 단번에 갈등을 풀어내는 백전백승 변호사의 지혜지략
(독서광) 이제는 이기는 인생을 살고 싶다 - 적을 만들지 않고 단번에 갈등을 풀어내는 백전백승 변호사의 지혜지략(독서광) 이제는 이기는 인생을 살고 싶다 - 적을 만들지 않고 단번에 갈등을 풀어내는 백전백승 변호사의 지혜지략
(독서광) 이제는 이기는 인생을 살고 싶다 - 적을 만들지 않고 단번에 갈등을 풀어내는 백전백승 변호사의 지혜지략
 
(독서광) 프로덕트 매니저 원칙: 10년이 가도 변하지 않을 PM/PO로 살아가는 원칙과 철학
(독서광) 프로덕트 매니저 원칙: 10년이 가도 변하지 않을 PM/PO로 살아가는 원칙과 철학(독서광) 프로덕트 매니저 원칙: 10년이 가도 변하지 않을 PM/PO로 살아가는 원칙과 철학
(독서광) 프로덕트 매니저 원칙: 10년이 가도 변하지 않을 PM/PO로 살아가는 원칙과 철학
 
(독서광) 개발자로 첫 출근했어요 - 사내 개발 도구, 기술, 문화 적응 가이드
(독서광) 개발자로 첫 출근했어요 - 사내 개발 도구, 기술, 문화 적응 가이드(독서광) 개발자로 첫 출근했어요 - 사내 개발 도구, 기술, 문화 적응 가이드
(독서광) 개발자로 첫 출근했어요 - 사내 개발 도구, 기술, 문화 적응 가이드
 
(독서광) 책 vs 책: 코딩 테스트 합격자 되기 vs 파이썬 알고리즘 인터뷰
(독서광) 책 vs 책: 코딩 테스트 합격자 되기 vs 파이썬 알고리즘 인터뷰(독서광) 책 vs 책: 코딩 테스트 합격자 되기 vs 파이썬 알고리즘 인터뷰
(독서광) 책 vs 책: 코딩 테스트 합격자 되기 vs 파이썬 알고리즘 인터뷰
 
(독서광) 테니스 이너 게임
(독서광) 테니스 이너 게임(독서광) 테니스 이너 게임
(독서광) 테니스 이너 게임
 
(독서광) 인간 vs. AI 정규표현식 문제 풀이 대결
(독서광) 인간 vs. AI 정규표현식 문제 풀이 대결(독서광) 인간 vs. AI 정규표현식 문제 풀이 대결
(독서광) 인간 vs. AI 정규표현식 문제 풀이 대결
 
(독서광) 모던 리눅스 교과서
(독서광) 모던 리눅스 교과서(독서광) 모던 리눅스 교과서
(독서광) 모던 리눅스 교과서
 
(독서광) 상자 밖에 있는 사람
(독서광) 상자 밖에 있는 사람(독서광) 상자 밖에 있는 사람
(독서광) 상자 밖에 있는 사람
 
(독서광) 자바 알고리즘 인터뷰 with 코틀린
(독서광) 자바 알고리즘 인터뷰 with 코틀린(독서광) 자바 알고리즘 인터뷰 with 코틀린
(독서광) 자바 알고리즘 인터뷰 with 코틀린
 
(독서광) 리그 오브 레전드 플레이어 중심주의
(독서광) 리그 오브 레전드 플레이어 중심주의(독서광) 리그 오브 레전드 플레이어 중심주의
(독서광) 리그 오브 레전드 플레이어 중심주의
 
(일상다반사) 2023년 구독자 3,000명 돌파 이벤트
(일상다반사) 2023년 구독자 3,000명 돌파 이벤트(일상다반사) 2023년 구독자 3,000명 돌파 이벤트
(일상다반사) 2023년 구독자 3,000명 돌파 이벤트
 
(독서광) 오늘날 우리는 컴퓨터라 부른다
(독서광) 오늘날 우리는 컴퓨터라 부른다(독서광) 오늘날 우리는 컴퓨터라 부른다
(독서광) 오늘날 우리는 컴퓨터라 부른다
 
(독서광) 사실은 이것도 디자인입니다
(독서광) 사실은 이것도 디자인입니다(독서광) 사실은 이것도 디자인입니다
(독서광) 사실은 이것도 디자인입니다
 
(독서광) 프로덕트 매니지먼트
(독서광) 프로덕트 매니지먼트(독서광) 프로덕트 매니지먼트
(독서광) 프로덕트 매니지먼트
 
(독서광) 슬기로운 파이썬 트릭
(독서광) 슬기로운 파이썬 트릭(독서광) 슬기로운 파이썬 트릭
(독서광) 슬기로운 파이썬 트릭
 

Kürzlich hochgeladen

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Kürzlich hochgeladen (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기

  • 1. [5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기 박재호(jrogue@gmail.com)
  • 2. 참고 자료 • <컴퓨터 vs 책> 블로그 • http://jhrogue.blogspot.com/ • OKdevTV 유튜브 방송 • 오늘자 방송 • https://www.youtube.com/watch?v=KH3mirEkZKU&list=PLdntWJk2tJPLKNNYBVCxn de2PEB6dzbSL&index=14 • 5분 따라하기 리스트: • https://www.youtube.com/playlist?list=PLdntWJk2tJPLKNNYBVCxnde2PEB6dzbSL • 슬라이드 셰어 • https://www.slideshare.net/jrogue/presentations • ASCIINEMA • https://asciinema.org/~jrogue
  • 3. 선행 조건 • Visual Studio에 영문 언어팩 설치
  • 4. 오늘 소개할 내용 • 자바스크립트와 파이썬과는 달리 C/++에서는 JSON을 언어 차 원에서 지원하지 않음 • 이런 상황에서 비주얼 스튜디오에서 C++ 프로그램을 개발할 때 어떻게 해야할까?
  • 5. 패키지로 설치하는 방법 • vcpkg! • https://docs.microsoft.com/ko-kr/cpp/build/vcpkg?view=vs-2019 • C++용 명령행 패키지 관리자 • 교차 플랫폼 지원: 윈도우, 리눅스, MacOS X • 윈도우 카탈로그에 등록된 경우 소스 코드를 다운로드해서 빌드 → 컴 파일러 버전 문제 해소
  • 6. 설치 • $ git clone https://github.com/Microsoft/vcpkg.git • $ cd vcpkg • $ ./bootstrap-vcpkg.sh • $ ./vcpkg integrate install • $ ./vcpkg search | grep json • $ ./vcpkg install nlohmann-json
  • 7. 실행 결과(예시) $ git clone https://github.com/Microsoft/vcpkg.git Cloning into 'vcpkg'... remote: Enumerating objects: 1, done. remote: Counting objects: 100% (1/1), done. remote: Total 86762 (delta 0), reused 0 (delta 0), pack-reused 86761 Receiving objects: 100% (86762/86762), 25.61 MiB | 8.41 MiB/s, done. Resolving deltas: 100% (53902/53902), done. Updating files: 100% (5288/5288), done. $ ./bootstrap-vcpkg.sh Building vcpkg.exe ... pch.cpp archives.cpp checks.cpp chrono.cpp ... vcpkgpaths.cpp versiont.cpp visualstudio.cpp vcpkg.cpp ... Building vcpkg.exe... done. $ ./vcpkg integrate install Applied user-wide integration for this vcpkg root. All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available. CMake projects should use: "- DCMAKE_TOOLCHAIN_FILE=C:/Users/jaypark/vcpkg/scripts/buildsystems/vcpkg. cmake"
  • 8. 실행 결과(예시) $ ./vcpkg search | grep json arrow[json] JSON file support bitserializer[cpprestjson-archive] Module for support JSON (implementation based on the CppRestSDK library) bitserializer[rapidjson-archive] Module for support JSON (implementation based on the RapidJson library) bitserializer-cpp... alias Deprecated alias for bitserializer-cpprestjson bitserializer-rap... alias Deprecated alias for bitserializer-rapidjson cjson 2019-11-30-1 Ultralightweight JSON parser in ANSI C cjson[utils] Enable building the cJSON_Utils library json-c 2019-09-10 A JSON implementation in C json-dto 0.2.9.2 A small header-only library for converting data between json representation an... json-schema-valid... 2.1.0 This is a C++ library for validating JSON documents based on a JSON Schema. Th... json-spirit 4.1.0-1 json parser using boost library json11 2017-06-20-2 json11 is a tiny JSON library for C++11, providing JSON parsing and serializat... json5-parser 1.0.0-1 An enhancement of the JSON Spirit C++ library to understand json5. jsoncons 0.155.1 A C++, header-only library for constructing JSON and JSON-like text and binary... jsoncpp 1.9.2 jsoncpp is an implementation of a JSON reader and writer in C++. JSON (JavaScr... jsonnet 0.14.0-1 Jsonnet - The data templating language jwt-cpp 0.4.0 A header only library for creating and validating json web tokens in c++ nlohmann-json 3.9.1 JSON for Modern C++ parson 2019-07-11 a lighweight json library written in C picojson 1.3.0-1 A header-file-only, JSON parser serializer in C++. rapidjson 2020-02-08 A fast JSON parser/generator for C++ with both SAX/DOM style API <http://rapid... sajson 2018-09-21 Lightweight, extremely high-performance JSON parser for C++11 simdjson 0.4.6 A extremely fast JSON library that can parse gigabytes of JSON per second sqlite3[json1] enable JSON functionality for sqlite3 taocpp-json 2019-07-11 C++ header-only JSON library valijson 2018-11-17-1 Header-only C++ library for JSON Schema validation
  • 9. 실행 결과(예시) $ ./vcpkg install nlohmann-json Computing installation plan... A suitable version of cmake was not found (required v3.17.2). Downloading portable cmake v3.17.2... Downloading cmake... https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-win32-x86.zip -> C:Usersjayparkdocumentsvcpkgdownloadscmake-3.17.2-win32-x86.zip Extracting cmake... A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0... Downloading 7zip... https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:Usersjayparkdocumentsvcpkgdownloads7- zip.commandline.18.1.0.nupkg Extracting 7zip... A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1... Downloading nuget... https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> C:Usersjayparkdocumentsvcpkgdownloads22ea847d-nuget.exe The following packages will be built and installed: nlohmann-json[core]:x86-windows Detecting compiler hash for triplet x86-windows... A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1... Downloading powershell-core... https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip -> C:UsersjayparkvcpkgdownloadsPowerShell-6.2.1-win-x86.zip Extracting powershell-core...
  • 10. 실행 결과(예시) Starting package 1/1: nlohmann-json:x86-windows Building package nlohmann-json[core]:x86-windows... Could not locate cached archive: C:UsersjayparkAppDataLocalvcpkg/archives1e1e699d54ec05be35d7ea0e7c4de7a1672bd0b286.zip -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/CMakeLists.txt... -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/LICENSE.MIT... -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/nlohmann_json.natvis... -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/config.cmake.in... -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/pkg-config.pc.in... -- Downloading https://github.com/nlohmann/json/raw/v3.9.1/cmake/nlohmann_jsonConfigVersion.cmake.in... -- Downloading https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip... -- Extracting source C:/Users/jaypark/documents/vcpkg/downloads/nlohmann-json-v3.9.1-include.zip -- Using source at C:/Users/jaypark/documents/vcpkg/buildtrees/nlohmann-json/3.9.1-74ced61d52.clean -- Configuring x86-windows -- Building x86-windows-dbg -- Building x86-windows-rel -- Installing: C:/Users/jaypark/documents/vcpkg/packages/nlohmann-json_x86-windows/share/nlohmann-json/copyright -- Performing post-build validation -- Performing post-build validation done Stored binary cache: C:UsersjayparkAppDataLocalvcpkg/archives1e1e699d54ec05be35d7ea0e7c4de7a1672bd0b286.zip Building package nlohmann-json[core]:x86-windows... done Installing package nlohmann-json[core]:x86-windows... Installing package nlohmann-json[core]:x86-windows... done Elapsed time for package nlohmann-json:x86-windows: 12.56 s Total elapsed time: 30.43 s The package nlohmann-json:x86-windows provides CMake targets: find_package(nlohmann_json CONFIG REQUIRED) target_link_libraries(main PRIVATE nlohmann_json nlohmann_json::nlohmann_json)
  • 11. 실제 사용(예시) #include <nlohmann/json.hpp> using nlohmann::json; json j1 = json::parse(json_string); // 파싱 // 1st class data type json j2 = { {"pi", 3.141}, {"happy", true}, {"name", "Niels"}, {"nothing", nullptr}, {"answer", { {"everything", 42} }}, {"list", {1, 0, 2}}, {"object", { {"currency", "USD"}, {"value", 42.99} }} }; json j3 = "{ "happy": true, "pi": 3.141 }"_json; // serialize