【问题标题】:How to install and use Wt (web GUI library) in WSL如何在 WSL 中安装和使用 Wt(Web GUI 库)
【发布时间】:2021-05-17 06:31:32
【问题描述】:

我在 Windows 10 上使用 WSL2 (Debian)。

如何安装和使用 Wt 库?

当我尝试使用 Wt 网站上推荐的命令时

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

我明白了:

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

【问题讨论】:

    标签: wsl-2 wt


    【解决方案1】:

    下载

    必需的包

    $ sudo apt -y install g++ cmake
    

    安装 Boost 库

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

    头文件和库分别在/usr/local/include/boost/usr/local/lib

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

    安装 Wt 库

    $ 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
    

    试试看

    (需要示例)

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

    打开浏览器并浏览到http://127.0.0.1:8080/

    【讨论】:

      猜你喜欢
      • 2020-06-14
      • 2020-03-13
      • 1970-01-01
      • 2020-10-11
      • 1970-01-01
      • 1970-01-01
      • 2021-04-02
      • 1970-01-01
      • 2020-11-18
      相关资源
      最近更新 更多