-
Jsoncpp 빌드Programming/c++ 2021. 9. 13. 14:04728x90
visual studio 2017 프로젝트에 Jsosncpp 오픈 소스를 적용하기 위해서 먼저 Jsoncpp를 빌드해야합니다.
방법은 여러가지가 있는데 저는 그중에서 CMake를 이용해서 빌드하려고 합니다.
가장 많이 사용하는 Json 오픈 소스인 Jsoncpp git 사이트에 접속합니다.
https://github.com/open-source-parsers/jsoncpp
1. Download ZIP을 클릭해서 전체 소스를 파일로 다운로드 합니다.
원하는 경로에 압축을 풉니다.
2. cmake를 이용해서 프로젝트를 만듭니다.
:명령 프롬프트를 띄우고 다운 받은 jsoncpp 파일이 있는 경로로 들어갑니다.
cmake CMakeLists.txt -B json_git -G "Visual Studio 15 2017 Win64" 명령어를 입력해서 프로젝트를 만듭니다.
이 때 , 'cmake' 은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.
라는 실패 메시지가 나온다면 CMake 를 설치하지 않아서 생긴 메시지입니다.
CMake를 먼저 설치 후에 진행하면 됩니다.
CMake 설치 방법 : https://code-space.tistory.com/entry/CMake-%EC%84%A4%EC%B9%98%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95-Windows
3. json-git 폴더가 생성된 것을 확인 할 수 있습니다.
4. json-git 폴더에 생성된 jsoncpp.sln 파일을 오픈합니다.
5. jsoncpp_lib 파일을 빌드합니다.
6. jsoncpp.lib 파일이 생성됩니다.
이제 이 jsoncpp.lib 파일을 프로젝트에 적용하여 json 을 사용할 수 있습니다.
728x90'Programming > c++' 카테고리의 다른 글
[c++] unique 함수 (0) 2022.08.01 [c++] std::accumulate 함수 vector sum (0) 2022.07.16 [c++] Visual Studio Code c++ 설정 (0) 2022.06.26 [c++] isdigit() 함수 (0) 2022.05.28 Jsoncpp 적용하기 (Visual Studio 2017) 방법1 (0) 2021.09.14