libhttpserverメモ

C++のhttpサーバライブラリlibhttpserverをインストールする際にコケたことの備忘録

github.com

以下は特に問題なくインストールする。

The minimum versions required are:

g++ >= 5.5.0 or clang-3.6
C++17 or newer
libmicrohttpd >= 0.9.64
[Optionally]: for TLS (HTTPS) support, you'll need libgnutls.
[Optionally]: to compile the code-reference, you'll need doxygen.

以下の手順で本体のインストール

./bootstrap
mkdir build
cd build
../configure
make
make install # (optionally to install on the system)

生成されたexamplesにあるhello_worldを構築するも"C++17"の環境じゃないのでコンパイルできない。確認してください、的なメッセージを受け取る。

どこかの手順に"-std=c++17"のフラグを渡さないといけないのだけど、

./configure -CXXFLAGS="-std=c++17"

を行うも、うまく行かない。

以下のページで

www.katsuster.net

ブートストラップモードのときは configure に CFLAGS, CXXFLAGS を指定する方法は使えません。

とのことで、

./bootstrap BOOT_CFLAGS="-std=c++17"

で、うまく通った。