Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install and use Wt (web GUI library) in WSL

I'm using WSL2 (Debian) on Windows 10.

How can I install and use Wt library?

When I try to use the recommended command on the Wt website

$ sudo apt-get install witty witty-dev witty-doc witty-dbg witty-examples

I get this:

E: Unable to locate package witty
E: Unable to locate package witty-dev
E: Unable to locate package witty-doc
E: Unable to locate package witty-dbg
E: Unable to locate package witty-examples
like image 885
Emanuel Oliveira Avatar asked Nov 02 '25 08:11

Emanuel Oliveira


1 Answers

Downloads

  • Wt from https://www.webtoolkit.eu/wt (e.g. wt-4.5.0.tar.gz)
  • Boost from https://www.boost.org/users/download/ (e.g. boost_1_75_0.tar.gz)

Required Packages

$ sudo apt -y install g++ cmake

Install Boost Library

$ tar xvfz boost_1_75_0.tar.gz
$ cd boost_1_75_0
$ ./bootstrap.sh
$ sudo ./b2 install

The header files and the libraries are in /usr/local/include/boost and /usr/local/lib, respectively.

$ sudo ldconfig /usr/local/lib    # Update ldconfig cache

Install Wt Library

$ tar xvfz wt-4.5.0.tar.gz
$ cd wt-4.5.0
$ mkdir build
$ cd build
$ cmake ../
$ make
$ sudo make install
$ make -C examples   # optional

Try It

(examples required)

$ cd examples/hello/
$ ln -s ../../../resources/
$ ./hello.wt --docroot . --http-listen 0.0.0.0:8080

Open the browser and browse to http://127.0.0.1:8080/ .

like image 178
Emanuel Oliveira Avatar answered Nov 04 '25 02:11

Emanuel Oliveira