Skip to content

Installing and using libhttpserver on FreeBSD 12.2

Pavel Kirichenko edited this page Jan 20, 2021 · 1 revision

Prepare

cd /usr/ports/www/libmicrohttpd
sudo make config install clean

Install libhttpserver

git clone https://github.com/etr/libhttpserver.git
cd ./libhttpserver
./bootstrap
mkdir ./build
cd ./build
../configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
gmake
sudo gmake install (optional)

Usage

Code

#include<httpserver.hpp>

Makefile

CC := g++
CFLAGS := -I/usr/local/include -L/usr/local/lib -g
OBJECTS :=
LIBRARIES := -lhttpserver
.PHONY: all clean
all: minimal_https
minimal_https: $(CC) $(CFLAGS) -o minimal_https minimal_https.cpp $(LIBRARIES)
clean:
rm -f *.o

Compile

make