金子邦彦研究室インストールWindows の種々のソフトウェア(インストール)glew のインストール(Windows 上)

glew のインストール(Windows 上)

下に書いているように,vcpkg を利用してインストールすることができる. 特に問題がない場合には vcpkg の利用してのインストールを検討しよう. vcpkg使わずにインストールする必要がある場合は,このページの手順によりインストールを行うことができる.

glew のインストール(vcpkg を利用)(Windows 上)

  1. Git のインストール

    Windows での Git のインストール: 別ページ »で説明している.

  2. Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022)のインストール

    Windows での Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022) のインストール: 別ページ »で説明している.

  3. vckpg のインストール

    Windows で,コマンドプロンプト管理者として実行.

    次のコマンドを実行

    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\")"
    )
    
  4. glew のインストール

    次のコマンドを実行

    c:\vcpkg\vcpkg search glew
    c:\vcpkg\vcpkg install --triplet x64-windows glew
    powershell -command "[System.Environment]::SetEnvironmentVariable(\"GLEW_ROOT\", \"C:\vcpkg\installed\x64-windows\", \"Machine\")"
    

glew のインストール(Windows 上)

  1. Windows で,コマンドプロンプト管理者として実行.

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  2. 次のコマンドを実行
    cd c:\
    mkdir glew
    cd glew
    curl -L -O https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0-win32.zip
    powershell -command "Expand-Archive -Path glew-2.2.0-win32.zip ."
    

    [image]
  3. Windowsシステム環境変数 Path に,c:\glew\glew-2.2.0\bin追加することにより,パスを通す

    次のコマンドを実行

    powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";c:\glew\glew-2.2.0\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"
    

    [image]
  4. Windowsシステム環境変数 GLEW_ROOT に,c:\glew\glew-2.2.0 を設定

    次のコマンドを実行

    powershell -command "[System.Environment]::SetEnvironmentVariable(\"GLEW_ROOT\", \"c:\glew\glew-2.2.0\", \"Machine\")"
    

    [image]