Wt - This is a library for developing web interfaces in C++

Wt allows you to create interactive web interfaces with widgets, does not require writing JavaScript, automates request processing and page rendering. Wt does all the request processing and page rendering for you, so you can focus on functionality

Wt 4.10.4 (C++): download wt-4.10.4.tar.gz (release notes)

In addition to C++, there is a similar version for Java

JWt 4.10.4 (Java): download jwt-4.10.4.zip (release notes)

https://www.webtoolkit.eu/wt

Wt HelloWorld in C++ 17

Makefile project Wt HelloWorld in C++ 17

The Wt library is used in the following projects

NuLL3rr0r/blog-subscription-service

A multilingual blog subscription service written in C++ on top of Wt webtoolkit

C++, Updated on Apr 16, 2021

yvanvds/wtMapbox

a mapbox wrapper for webtoolkit

JavaScript, Updated on Jul 19, 2016

arlukin/avshop A c++ webshop, build with Wt (http://www.webtoolkit.eu).

C++, Updated on Feb 13, 2011

traw/blog-wt

A simple blog webapp, written in C++, using wt (web toolkit - http://www.webtoolkit.eu/wt).

C++, Updated on Mar 9, 2014

ajneu/witty

Witty Wt C++ webtoolkit - Build tutorial and example

CMake, Updated on Jan 6, 2016

matiu2/vidanueva

Church website done in Wt (from webtoolkit.eu)

C++, Updated on Jun 17, 2013

xstackman/wtservercpp

Basic Web Server with WebToolKit with C++

Updated on Apr 12, 2022

Archipel/cdWt

A c++ wrapper to Eweb's Webtoolkit linkable from Dlang

C++, Updated on Dec 7, 2014

ReWeb3D/wtgles2

wtgles2 provides an OpenGLES2 library and serializes the commands to WebgGL using WebToolkit (Wt)

C++, Updated on Nov 29, 2012

siof/hellground-panel

Players panel prepared for HellGround project. Written using WT (webtoolkit.eu) and boost libraries.

C, Updated on Oct 13, 2019

sunbeam96/wtSimpleCrud

Very simple webtoolkit example for web application that provides string input, string listing and removal from storage. For testing and a…

C++, Updated on May 20, 2023

gcobb1/PowerPuzzle

A Puzzling Algorithm Visualizer! This Web Application is written entirely in C++, making it fast and efficient. It utilizes Wt WebToolkit …

C++, Updated on Aug 25, 2020

Wt requirements

  • OpenSSL for SSL and WebSockets support in

the built-in httpd, the HTTP(S) client, and additional cryptographic

hashes in the authentication module

to PNG, GIF (on Windows, Direct2D can be used instead)

for the Microsoft SQL Server Dbo backend, and unixODBC on Unix-like platforms

  • Firebird for the Firebird Dbo backend
  • Pango for improved font support in PDF and raster

image painting. On Windows, DirectWrite can be used instead.

  • ZLib for compression in the built-in httpd.

Possible compilation errors during installation

Add Header to wt-4.10.4/src/web/FileUtils.C

#include <boost/filesystem.hpp>

Replace Procedure, line 310 wt-4.10.4/src/http/Server.C

std::vector<asio::ip::address> Server::resolveAddress(
    asio::ip::tcp::resolver &resolver,
    const std::string &address)
{
  std::vector<asio::ip::address> result;
  Wt::AsioWrapper::error_code ec;
  asio::ip::address fromStr = asio::ip::make_address(address, ec);
  if (!ec) {
    // The address is not a hostname, because it can be parsed as an
    // IP address, so we don't need to resolve it
    result.push_back(fromStr);
    return result;
  } else {
#ifndef NO_RESOLVE_ACCEPT_ADDRESS
    // Resolve both IPv4 and IPv6
    asio::ip::tcp::resolver::results_type endpoints = resolver.resolve(address, "http", ec);
    if (!ec) {
      for (const auto& endpoint : endpoints) {
        result.push_back(endpoint.endpoint().address());
      }
    }

    if (result.empty()) {
      LOG_WARN_S(&wt_, "Failed to resolve hostname \"" << address << "\": " << ec.message());
    } else {
      if (std::none_of(result.begin(), result.end(),
                       [](const asio::ip::address& addr) { return addr.is_v4(); })) {
        LOG_DEBUG_S(&wt_, "Failed to resolve hostname \"" << address << "\" as IPv4");
      }
      if (std::none_of(result.begin(), result.end(),
                       [](const asio::ip::address& addr) { return addr.is_v6(); })) {
        LOG_DEBUG_S(&wt_, "Failed to resolve hostname \"" << address << "\" as IPv6");
      }
    }
#else // NO_RESOLVE_ACCEPT_ADDRESS
    LOG_WARN_S(&wt_, "Failed to resolve hostname \"" << address << "\": not supported");
#endif
  }
  return result;
}

Makefile

CXX = g++
CXXFLAGS = -std=c++17 -Wall -I/usr/local/include
LDFLAGS = -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lwthttp -lwt -lboost_system -lboost_thread -lboost_filesystem

TARGET = helloworld
SRCS = helloworld.cpp

all: $(TARGET)

$(TARGET): $(SRCS)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)

clean:
	rm -f $(TARGET)

run:
	./$(TARGET) --docroot . --http-address 0.0.0.0 --http-port 9091 --threads 4

.PHONY: all clean

Wt cannot be integrated into microprocessor systems. The closest analogues can be ESPAsyncWebServer