仮想計算機構

IT業界と無縁な派遣社員のブログ

TeXworks Editor にダークテーマを導入したい

はじめに

Texworks Editor をを白い背景のまま使うのはシンドイので、以下のQAを参考に背景色を変更します。
https://tex.stackexchange.com/questions/383271/how-can-i-set-a-dark-theme-in-texworks

環境

OS : Windows 10
TeXworks : 0.6.9

設定手順

まずは以下のファイルを作成し、mystyle.cssとして保存します。保存先は自由に決めてください。

QTextEdit {
    background-color: black;  
    color: white;
}

TeXworks Editor のショートカットのある場所を開きます。

右クリックでプロパティを選択します。

リンク先の欄を以下のように修正し、適用ボタンを押します。mystyle.css の保存先に応じてパスを変更してください。

C:\texlive\2024\bin\windows\texworks.exe -stylesheet C:\path\to\mystyle.css

プロパティ画面を閉じ、TeXworks Editor を開きます。

ダークモードっぽい画面にできました。

Maxima を Windows10 にインストールする

1.ファイルのダウンロード

公式サイトの記述にしたがい、インストールを行います。
https://maxima.sourceforge.io/windows-install.html

2024年3月3日時点での安定版であるバージョン5.47.0をダウンロードします。
https://sourceforge.net/projects/maxima/files/Maxima-Windows/5.47.0-Windows/

緑のボタンを押すとダウンロードが始まります。


2.インストーラを起動する

ダウンロードフォルダの maxima-5.47.0-win64.exe をダブルクリックします。

3.セットアップ画面の操作

次へボタンを押します。

インストールフォルダを選びます。

そのまま次へ進みます。

特にチェックは外さず、インストールボタンを押します。

数分程度でインストールが完了します。


4.アプリを起動する

インストールされたフォルダ内の bin を開き、wxmaxima.exe をダブルクリックします。

5.プロットしてみる

maxima が起動したら試しに放物線をプロットします。

以下のコードを貼り付け、Shift+Enterを押します。

plot2d(x^2,[x,-1,1]);

結果は以下のとおりです。


PARI/GP を Windows10 にインストールする

1.公式サイトからWindowsバイナリ(64ビット)をダウンロードする

https://pari.math.u-bordeaux.fr/download.html


2.ダウンロードしたファイルを実行する

下記の警告が表示されるが無視して実行ボタンを押す。


3.セットアップ画面が立ち上がる。Nextボタンを押す。


4.インストールしたいものを選ぶ。

ディスクスペースを対してとらないので、すべてにチェックを入れたまま次へ進む。


5.インストールするフォルダを選ぶ。


6.インストール完了

Finish を押すとエクスプローラーが立ち上がり、インストールしたフォルダが開く。


7. gp.exeを起動する。


8.サンプルを動かす。

公式サイトに記載されている下記のサンプル(ゼータ関数のプロット)をコピーして貼り付ける。

ploth(x=0,20,zeta(1/2+I*x),"Complex") 

実行すると結果が emf 形式で開く。当該ファイルをどのソフトウェアで開くか訊かれるのでペイントを選択する。結果は下記の通り。

ガウス平面の原点を通っているので1/2から1/2+20iの間にゼータ関数の零点があることがわかる。

hiredisをソースからインストールする

前回 Redis をインストールしたので今回は hiredis をインストールします。

環境

$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l

インストール

ソースを持ってきます。

$ git clone https://github.com/redis/hiredis.git

make します。

$ cd hiredis/
$ make

make install します。

$ sudo make install
[sudo] password for (省略):
mkdir -p /usr/local/include/hiredis /usr/local/include/hiredis/adapters /usr/local/lib
cp -pPR hiredis.h async.h read.h sds.h alloc.h sockcompat.h /usr/local/include/hiredis
cp -pPR adapters/*.h /usr/local/include/hiredis/adapters
cp -pPR libhiredis.so /usr/local/lib/libhiredis.so.1.2.1-dev
cd /usr/local/lib && ln -sf libhiredis.so.1.2.1-dev libhiredis.so && ln -sf libhiredis.so.1.2.1-dev libhiredis.so.1
cp -pPR libhiredis.a /usr/local/lib
mkdir -p /usr/local/lib/pkgconfig
cp -pPR hiredis.pc /usr/local/lib/pkgconfig

デフォルトでは /usr/local/lib および /usr/local/include に必要なファイルが作成されます。

サンプルプログラムの実行

hiredis/example ディレクトリにある example.c を動かしてみます。

コンパイル

$ gcc example.c -I/usr/local/include/hiredis -lhiredis

実行します。

$ ./a.out
./a.out: error while loading shared libraries: libhiredis.so.1.2.1-dev: cannot open shared object file: No such file or directory

共有ライブラリがないぞと怒られました。

エラー解決

実行ファイルが利用する共有ライブラリを調べてみます。
参考:第29回 共有ライブラリと依存関係[1] | gihyo.jp

$ ldd a.out
        linux-vdso.so.1 (0x00007ffeb69be000)
        libhiredis.so.1.2.1-dev => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd64cb8c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd64cdc4000)

hiredisの共有ライブラリだけ not found と表示されています。

環境変数を使って共有ライブラリのパスを指定します

$ export LD_LIBRARY_PATH=/usr/local/lib

参考:Linuxで共有ライブラリの作成とダイナミックリンクをする方法: 小粋空間

もう一度 ldd コマンドで調べます。

$ ldd a.out
        linux-vdso.so.1 (0x00007fffb5954000)
        libhiredis.so.1.2.1-dev => /usr/local/lib/libhiredis.so.1.2.1-dev (0x00007f0615d8a000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0615b59000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0615da7000)

not foundの表示が消えました。

改めて実行する

$ ./a.out
Connection error: Connection refused

共有ライブラリのエラーは消えましたが、Connection refused と表示されました。

redisが動いているか確認します。

$ redis-cli ping
Could not connect to Redis at 127.0.0.1:6379: Connection refused

サーバを起動します。

$ redis-server &
[1] 67300
(省略)

再度実行します。

$ ./a.out
PING: PONG
SET: OK
SET (binary API): OK
GET foo: hello world
INCR counter: 1
INCR counter: 2
0) element-9
1) element-8
2) element-7
3) element-6
4) element-5
5) element-4
6) element-3
7) element-2
8) element-1
9) element-0
RPUSH reply: 10

サンプルを正常に動かすことができました。

サーバを終了させます。

$ redis-cli shutdown
67300:M 21 Sep 2023 07:51:34.970 * User requested shutdown...
67300:M 21 Sep 2023 07:51:34.970 * Saving the final RDB snapshot before exiting.
67300:M 21 Sep 2023 07:51:34.973 * DB saved on disk
67300:M 21 Sep 2023 07:51:34.973 # Redis is now ready to exit, bye bye...
[1]+  Done                    redis-server

共有ライブラリが見つからなかったときの対処

環境変数の設定

今回は環境変数の設定で共有ライブラリの問題を解決しましたが、毎回 export と唱えるわけにはいかないので bash_profile に書いておきます。

$ emacs ~/.bash_profile

下記のとおり記述します。

export LD_LIBRARY_PATH=/usr/local/lib

設定を反映させます。

$ source ~/.bash_profile

②confファイルの作成

/etc/ld.so.conf.d/配下に設定を書き、ldconfigを実行するという方法もあるようです。筆者の環境では下記のとおり、3つの設定ファイルがすでにありました。

$ ls /etc/ld.so.conf.d
fakeroot-x86_64-linux-gnu.conf  libc.conf  x86_64-linux-gnu.conf

ここにもう一つhiredis.confといった名前の設定ファイルを追加してldconfigするというのが選択肢の1つとなります。bash_profileに追記するという方法をとったので、今回はhiredis.confの作成はしていません。

参考

③LDFLAGを使う

コンパイル時にLDFLAGを指定する方法もあるようです。hiredis のコンパイル時にこの方法を使うことも可能だと思われますが、再度コンパイルするのが面倒だったので今回は試しておりません。
参考:Linux: ライブラリの動的リンクでエラーが出た場合の対処方法

まとめ

以上でC言語からredisを利用できるようになりました。

Redis をソースからインストールする

環境

$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l

インストール

ダウンロード

下記参考にソースをダウンロードします。
Install Redis from Source | Redis

$ wget https://download.redis.io/redis-stable.tar.gz
--2023-09-20 19:12:43--  https://download.redis.io/redis-stable.tar.gz
Resolving download.redis.io (download.redis.io)... 45.60.125.1
Connecting to download.redis.io (download.redis.io)|45.60.125.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3477351 (3.3M) [application/octet-stream]
Saving to: 'redis-stable.tar.gz'

redis-stable.tar.gz      100%[==================================>]   3.32M  --.-KB/s    in 0.05s
2023-09-20 19:12:44 (70.1 MB/s) - 'redis-stable.tar.gz' saved [3477351/3477351]

解凍

$ tar -xzvf redis-stable.tar.gz
redis-stable/
redis-stable/src/
redis-stable/src/geohash.h
redis-stable/src/redis-trib.rb
redis-stable/src/t_string.c
(省略)

ビルド

make します。

$ cd redis-stable
redis-stable$ make

一応 make test しておきます。

redis-stable$ make test
(省略)
\o/ All tests passed without errors!
(省略)

管理者権限で make install します。

redis-stable$ sudo make install
cd src && make install
(省略)

Hint: It's a good idea to run 'make test' ;)

    INSTALL redis-server
    INSTALL redis-benchmark
    INSTALL redis-cli
(省略)

インストールされたものを確認します。

redis-stable$ ls /usr/local/bin/
redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server

起動とシャットダウン

バージョン確認

$ redis-server -v
Redis server v=7.2.1 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=fce2f1bf15001fdc
$ redis-cli -v
redis-cli 7.2.1

サーバの起動

$ redis-server &
[1] 52809
(省略):~$ 52809:C 20 Sep 2023 21:08:37.630 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
52809:C 20 Sep 2023 21:08:37.631 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
52809:C 20 Sep 2023 21:08:37.631 * Redis version=7.2.1, bits=64, commit=00000000, modified=0, pid=52809, just started
52809:C 20 Sep 2023 21:08:37.631 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
52809:M 20 Sep 2023 21:08:37.632 * Increased maximum number of open files to 10032 (it was originally set to 1024).
52809:M 20 Sep 2023 21:08:37.632 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 7.2.1 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 52809
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

52809:M 20 Sep 2023 21:08:37.635 * Server initialized
52809:M 20 Sep 2023 21:08:37.635 * Ready to accept connections tcp

プロセスの確認

$ ps
    PID TTY          TIME CMD
  52788 pts/0    00:00:00 bash
  52809 pts/0    00:00:00 redis-server
  52814 pts/0    00:00:00 ps

サーバから返答があるか確認する

$ redis-cli ping
PONG

サーバを終了する

$ redis-cli shutdown
52809:M 20 Sep 2023 21:09:03.298 * User requested shutdown...
52809:M 20 Sep 2023 21:09:03.298 * Saving the final RDB snapshot before exiting.
52809:M 20 Sep 2023 21:09:03.301 * DB saved on disk
52809:M 20 Sep 2023 21:09:03.301 # Redis is now ready to exit, bye bye...
[1]+  Done                    redis-server

プロセスの確認

$ ps
    PID TTY          TIME CMD
  52788 pts/0    00:00:00 bash
  52817 pts/0    00:00:00 ps

Visual Studio で cpp-httplib のサンプルプログラムを動かす

GitHub - yhirose/cpp-httplib: A C++ header-only HTTP/HTTPS server and client library
cpp-httplib はヘッダーファイルのみの HTTP/HTTPS ライブラリです。本記事では本家サイトにあるサンプルを動かすことを目標とします。

0.環境

OS : WIndows 10
IDE : Microsoft Visual Studio Community 2019 Version 16.8.4

README には

NOTE: cpp-httplib officially supports only the latest Visual Studio. It might work with former versions of Visual Studio, but I can no longer verify it. Pull requests are always welcome for the older versions of Visual Studio unless they break the C++11 conformance.

NOTE: Windows 8 or lower, Visual Studio 2013 or lower, and Cygwin on Windows are not supported.

と書いてありますので OS や IDE が古い方はご注意ください。

1.プログラム

本家サイトにあるサンプルプログラムは下記の通りです。今回はWindowsで動かすのでヘッダー部分は書き換えておきます。

#include "httplib.h"
#include <Windows.h>

int main(void)
{
  using namespace httplib;

  Server svr;

  svr.Get("/hi", [](const Request& req, Response& res) {
    res.set_content("Hello World!", "text/plain");
  });

  // Match the request path against a regular expression
  // and extract its captures
  svr.Get(R"(/numbers/(\d+))", [&](const Request& req, Response& res) {
    auto numbers = req.matches[1];
    res.set_content(numbers, "text/plain");
  });

  // Capture the second segment of the request path as "id" path param
  svr.Get("/users/:id", [&](const Request& req, Response& res) {
    auto user_id = req.path_params.at("id");
    res.set_content(user_id, "text/plain");
  });

  // Extract values from HTTP headers and URL query params
  svr.Get("/body-header-param", [](const Request& req, Response& res) {
    if (req.has_header("Content-Length")) {
      auto val = req.get_header_value("Content-Length");
    }
    if (req.has_param("key")) {
      auto val = req.get_param_value("key");
    }
    res.set_content(req.body, "text/plain");
  });

  svr.Get("/stop", [&](const Request& req, Response& res) {
    svr.stop();
  });

  svr.listen("localhost", 1234);
}

ヘッダーファイル httplib.h は Github ページからダウンロードして、上記のファイルと同じディレクトリに置きます。Visual Studio 上では次のような構成になります。


2.ビルドと実行結果

「ソリューションのビルド」「デバッグなしで開始」を押下します。何も表示されていないコンソールが立ち上がると思います。コンソールは無視して localhost にアクセスしてみましょう。

2.2.ユーザー名

ユーザー名をそのまま表示します。
http://localhost:1234/users/777


2.3.数値

1桁以上の数値であれば、その数字が表示されます。
http://localhost:1234/numbers/0123456789


2.5.停止

http://localhost:1234/stop

上記 URL にアクセスするとコンソールにメッセージが表示されます。

サーバーが停止しているので Hello world を表示させようとしても次のような画面が表示されます。

サンプルプログラムを動きを確認できたので今回は以上です。

【自分用メモ】vcpkgを使ってcurlをインストールする

下記を参考にcurlをインストールします。あくまで自分用のメモです。
curl/docs/INSTALL.md at master · curl/curl · GitHub

0.環境

OS : Windows 10
端末 : Windows Terminal ( PowerShell )

1.vcpkg のインストール

> git clone https://github.com/Microsoft/vcpkg.git
Cloning into 'vcpkg'...
remote: Enumerating objects: 203084, done.
remote: Counting objects: 100% (17648/17648), done.
remote: Compressing objects: 100% (1191/1191), done.
remote: Total 203084 (delta 16755), reused 16585 (delta 16457), pack-reused 185436
Receiving objects: 100% (203084/203084), 62.00 MiB | 4.07 MiB/s, done.
Resolving deltas: 100% (135407/135407), done.
Updating files: 100% (10485/10485), done.
cd vcpkg
vcpkg > .\bootstrap-vcpkg.bat
Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2023-08-09/vcpkg.exe -> C:\Users\user\Desktop\MyProgram\vcpkg\vcpkg.exe... done.
Validating signature... done.

vcpkg package management program version 2023-08-09-9990a4c9026811a312cb2af78bf77f3d9d288416

See LICENSE.txt for license information.
Telemetry
---------
vcpkg collects usage data in order to help us improve your experience.
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.

Read more about vcpkg telemetry at docs/about/privacy.md
vcpkg > .\vcpkg.exe integrate install
Applied user-wide integration for this vcpkg root.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/Users/user/Desktop/MyProgram/vcpkg/scripts/buildsystems/vcpkg.cmake"

All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.

2.curl をインストールする

vcpkg> .\vcpkg.exe install curl[tool]
warning: Starting with the September 2023 release, the default triplet for vcpkg libraries will change from x86-windows to the detected host triplet (x64-windows). To resolve this message, add --triplet x86-windows to keep the same behavior.
Computing installation plan...
A suitable version of cmake was not found (required v3.27.1) Downloading portable cmake 3.27.1...
Downloading cmake...
https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-windows-i386.zip->C:\Users\user\Desktop\MyProgram\vcpkg\downloads\cmake-3.27.1-windows-i386.zip
Downloading https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-windows-i386.zip
Extracting cmake...
The following packages will be built and installed:
    curl[core,non-http,schannel,ssl,sspi,tool]:x86-windows -> 8.2.1
  * vcpkg-cmake:x64-windows -> 2023-05-04
  * vcpkg-cmake-config:x64-windows -> 2022-02-06#1
  * zlib:x86-windows -> 1.2.13
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
A suitable version of powershell-core was not found (required v7.2.11) Downloading portable powershell-core 7.2.11...
Downloading powershell-core...
https://github.com/PowerShell/PowerShell/releases/download/v7.2.11/PowerShell-7.2.11-win-x86.zip->C:\Users\user\Desktop\MyProgram\vcpkg\downloads\PowerShell-7.2.11-win-x86.zip
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.2.11/PowerShell-7.2.11-win-x86.zip
Extracting powershell-core...
Detecting compiler hash for triplet x86-windows...
A suitable version of 7zip was not found (required v21.7.0) Downloading portable 7zip 21.7.0...
Downloading 7zip...
https://www.7-zip.org/a/7z2107-extra.7z->C:\Users\user\Desktop\MyProgram\vcpkg\downloads\7z2107-extra.7z
Downloading https://www.7-zip.org/a/7z2107-extra.7z
Extracting 7zip...
Restored 0 package(s) from C:\Users\user\AppData\Local\vcpkg\archives in 1.09 ms. Use --debug to see more details.
Installing 1/4 vcpkg-cmake:x64-windows...
Building vcpkg-cmake:x64-windows...
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg-port-config.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 220 ms.
Elapsed time to handle vcpkg-cmake:x64-windows: 1.2 s
Installing 2/4 vcpkg-cmake-config:x64-windows...
Building vcpkg-cmake-config:x64-windows...
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg-port-config.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 52.8 ms.
Elapsed time to handle vcpkg-cmake-config:x64-windows: 237 ms
Installing 3/4 zlib:x86-windows...
Building zlib:x86-windows...
-- Downloading https://github.com/madler/zlib/archive/v1.2.13.tar.gz -> madler-zlib-v1.2.13.tar.gz...
-- Extracting source C:/Users/user/Desktop/MyProgram/vcpkg/downloads/madler-zlib-v1.2.13.tar.gz
-- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
-- Applying patch 0002-skip-building-examples.patch
-- Applying patch 0003-build-static-or-shared-not-both.patch
-- Applying patch 0004-android-and-mingw-fixes.patch
-- Using source at C:/Users/user/Desktop/MyProgram/vcpkg/buildtrees/zlib/src/v1.2.13-f30d2a168d.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/share/zlib/vcpkg-cmake-wrapper.cmake
-- Fixing pkgconfig file: C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/lib/pkgconfig/zlib.pc
-- Downloading https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst -> mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst -> msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst...
-- Using msys root at C:/Users/user/Desktop/MyProgram/vcpkg/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Fixing pkgconfig file: C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/debug/lib/pkgconfig/zlib.pc
CMake Warning at scripts/cmake/vcpkg_copy_pdbs.cmake:44 (message):
  Could not find a matching pdb file for:

      C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/bin/zlib1.dll
      C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/debug/bin/zlibd1.dll

Call Stack (most recent call first):
  ports/zlib/portfile.cmake:44 (vcpkg_copy_pdbs)
  scripts/ports.cmake:147 (include)


-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/zlib_x86-windows/share/zlib/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 129 ms.
Elapsed time to handle zlib:x86-windows: 36 s
Installing 4/4 curl:x86-windows...
Building curl[core,non-http,schannel,ssl,sspi,tool]:x86-windows...
-- Downloading https://github.com/curl/curl/archive/curl-8_2_1.tar.gz -> curl-curl-curl-8_2_1.tar.gz...
-- Extracting source C:/Users/user/Desktop/MyProgram/vcpkg/downloads/curl-curl-curl-8_2_1.tar.gz
-- Applying patch 0002_fix_uwp.patch
-- Applying patch 0005_remove_imp_suffix.patch
-- Applying patch 0012-fix-dependency-idn2.patch
-- Applying patch 0020-fix-pc-file.patch
-- Applying patch 0022-deduplicate-libs.patch
-- Applying patch mbedtls-ws2_32.patch
-- Applying patch export-components.patch
-- Applying patch dependencies.patch
-- Using source at C:/Users/user/Desktop/MyProgram/vcpkg/buildtrees/curl/src/curl-8_2_1-1a1f01a28f.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
CMake Warning at scripts/cmake/vcpkg_copy_pdbs.cmake:44 (message):
  Could not find a matching pdb file for:

      C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/bin/libcurl.dll
      C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/debug/bin/libcurl-d.dll

Call Stack (most recent call first):
  ports/curl/portfile.cmake:81 (vcpkg_copy_pdbs)
  scripts/ports.cmake:147 (include)


-- Fixing pkgconfig file: C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/lib/pkgconfig/libcurl.pc
-- Using cached mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using msys root at C:/Users/user/Desktop/MyProgram/vcpkg/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Fixing pkgconfig file: C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/debug/lib/pkgconfig/libcurl.pc
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/share/curl/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Users/user/Desktop/MyProgram/vcpkg/packages/curl_x86-windows/share/curl/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 538 ms.
Elapsed time to handle curl:x86-windows: 4 min
Total install time: 4.6 min
curl provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CURL::libcurl)

3.curl を使ってみる

> curl https://ja.wikipedia.org
StatusCode        : 200
StatusDescription : OK
Content           : <!DOCTYPE html>
                    <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-
                    page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-...
(以下略)