libiconv のインストールは,複数の方法がある.
以下,Windows で,libiconv をソースコードからビルドして,インストールする手順を説明する.MSYS2 を使用する.
【目次】
Windows での Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022) のインストール: 別ページ »で説明している.
次のコマンドを実行
if not exist c:\vcpkg ( cd c:\ rmdir /s /q vcpkg git clone https://github.com/microsoft/vcpkg cd c:\vcpkg git pull .\bootstrap-vcpkg.bat .\vcpkg update .\vcpkg integrate install powershell -command "[System.Environment]::SetEnvironmentVariable(\"VCPKG_ROOT\", \"c:\vcpkg\", \"Machine\")" powershell -command "[System.Environment]::SetEnvironmentVariable(\"VCPKG_DEFAULT_TRIPLET\", \"x64-windows\", \"Machine\")" powershell -command "[System.Environment]::SetEnvironmentVariable(\"CMAKE_TOOLCHAIN_FILE\", \"c:/vcpkg/scripts/buildsystems/vcpkg.cmake\", \"Machine\")" powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"LIB\", \"Machine\"); $oldpath += \";c:\vcpkg\installed\x64-windows\lib\"; [System.Environment]::SetEnvironmentVariable(\"LIB\", $oldpath, \"Machine\")" powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"INCLUDE\", \"Machine\"); $oldpath += \";c:\vcpkg\installed\x64-windows\include\"; [System.Environment]::SetEnvironmentVariable(\"INCLUDE\", $oldpath, \"Machine\")" powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";c:\vcpkg\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";c:\vcpkg\installed\x64-windows\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" )
次のコマンドを実行
c:\vcpkg\vcpkg search libiconv c:\vcpkg\vcpkg install --triplet x64-windows libiconv
MSYS2 は,ターミナル mintty とシェル bash と各種UNIX風コマンドの詰め合わせ.
Windows でのMSYS2 の MINGW64 環境のインストールと,LLVM(Clang, Flang, LLD, LLDB)のインストールと,GNU ツールチェーン類 (gcc, g++, gfortran, gdb, make, ninja, ccache, svn 等) のインストール(MSYS2 を利用 ): 別ページ »で説明
pacman -Sy libiconv
C:\msys64\mingw64\lib
コマンドプロンプトを管理者として実行: 別ページ »で説明
次のコマンドを実行
powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"LIB\", \"Machine\"); $oldpath += \";C:\msys64\mingw64\lib\"; [System.Environment]::SetEnvironmentVariable(\"LIB\", $oldpath, \"Machine\")"