본문 바로가기
프로그램 개발(분석, 설계, 코딩, 배포)/100. 기타

드로곤 HTTP 웹 서버 설치

by 3604 2026. 1. 11.
728x90

C++ 17 기반의 REST 서버 프레임워크를 연구하던 중 Drogon 프로젝트를 접하게 되었습니다 . https://github.com/an-tao/drogon/wiki/installation 에 설명된 지침에 따라 macOS에 Drogon을 설치해 보았습니다 .

$ git clone https://github.com/an-tao/drogon
 $ cd drogon 
$ git submodule update --init 
$ mkdir build 
$ cmake .. -B . 
$ make

이로 인해 다음과 같은 오류가 발생했습니다.

[ 49%] CXX 실행 파일 webapp_test 연결 중x86_64 아키텍처에 대한 정의되지 않은 기호:"Json::writeString[abi:cxx11](Json::StreamWriter::Factory const&, Json::Value const&)", 참조 위치:..."Json::StreamWriterBuilder::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)", 참조 위치:...ld: 아키텍처 x86_64에 대한 심볼을 찾을 수 없습니다. 
collect2: 오류: ld가 종료 코드 1을 반환했습니다. 
make[2]: *** [examples/webapp_test] 오류 1 
make[1]: *** [examples/CMakeFiles/webapp_test.dir/all] 오류 2 
make: *** [all] 오류 2

이 문제를 해결하려면 jsoncpp를 (다시) 설치해야 합니다. 이미 설치되어 있는 경우 다음 명령어를 사용하여 제거하십시오 brew uninstall jsoncpp.

그런 다음 소스에서 설치하세요. 빌드하려면 다음이 필요합니다. ossp-uuid, meson, ninja: brew install ossp-uuid meson ninja`

그다음은 제작하는 방법입니다.

$ git clone https://github.com/open-source-parsers/jsoncpp
 $ cd jsoncpp 
$ BUILD_TYPE=debug 
LIB_TYPE=shared 
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE} 
ninja -v -C build-${LIB_TYPE} 
cd build-${LIB_TYPE} 
meson test --no-rebuild --print-errorlogs 
sudo ninja install

그런 다음 drogon/build로 돌아가서 다시 실행하세요 make.

예제를 테스트하려면:

$ cd examples 
$ ./webapp 
20190216 21:43:38.066290 UTC 271689 DEBUG [TestController] TestController 생성자 - TestController.h:20 
     _ 
  __| |_ __ ___ __ _ ___ _ __ 
/ _` | '__/ _ \ / _` |/ _ \| '_ \ 
| (_| | | | (_) | (_| | (_) | | | | 
\__,_|_| \___/ \__, |\___/|_| |_| 
                 |___/20190216 21:43:38.077896 UTC 271689 INFO 실행 시작... - HttpAppFrameworkImpl.cc:200 
20190216 21:43:38.079254 UTC 271689 WARN HttpServer[drogon]이 0.0.0.0:8848에서 수신 대기를 시작합니다 - HttpServer.cc:70

다른 터미널에서:

curl http://localhost:8848 
<p>안녕하세요, 세상!</p>
728x90