0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

zlibのインストール

Last updated at Posted at 2025-03-12

環境構築

Visual Studio2022、git
7-Zipをインストールする。
CMake GUIの最新のリリース版をインストールする。

コマンド

C:\直下に移動し、管理者権限で以下のコマンドを実行する。

.bat
rmdir /s /q zlib-1.3.1
git clone https://github.com/madler/zlib.git
del zlib-1.3.1.tar.gz
curl -O https://zlib.net/zlib-1.3.1.tar.gz
del zlib-1.3.1.tar
"c:\Program Files\7-Zip\7z.exe" x zlib-1.3.1.tar.gz
rmdir /s /q libzlib-1.3.1
"c:\Program Files\7-Zip\7z.exe" x zlib-1.3.1.tar
.bat
cd zlib-1.3.1
rmdir /s /q build
mkdir build
cd build
del CMakeCache.txt
rmdir /s /q CMakeFiles\
cmake .. -G "Visual Studio 17 2022" -A x64 -T host=x64 ^
    -DCMAKE_INSTALL_PREFIX="c:/zlib-1.3.1"
.bat
cmake --build . --config RELEASE
.bat
cmake --build . --config RELEASE --target INSTALL

環境変数の設定

PATH」にC:\zlib-1.3.1\bin
ZLIB_ROOT」にC:\zlib-1.3.1
LIB」にC:\zlib-1.3.1\libをシステムの環境変数に設定する。

.bat
powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable('Path', 'Machine'); $oldpath += ';C:\zlib-1.3.1\bin'; [System.Environment]::SetEnvironmentVariable('Path', $oldpath, 'Machine')"
powershell -command "[System.Environment]::SetEnvironmentVariable('ZLIB_ROOT', 'C:\zlib-1.3.1', 'Machine')"
powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable('LIB', 'Machine'); $oldpath += ';C:\zlib-1.3.1\lib'; [System.Environment]::SetEnvironmentVariable('LIB', $oldpath, 'Machine')"

以上、お疲れ様でしたー

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?