LoginSignup
21
10

More than 5 years have passed since last update.

CMakeでコンパイラが設定されていない時の対処法

Posted at

環境

Windows10
Visual Studio 2015 インストール済
CMake 3.6.2 インストール済

参考

エラー内容

CとCXXのコンパイラがunknown

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (PROJECT):
  The CMAKE_C_COMPILER:

    wcl386

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:2 (PROJECT):
  The CMAKE_CXX_COMPILER:

    wcl386

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

原因

Visual StudioにC++のコンパイラがインストールされていなかった

対処法

Visual StudioでC++プロジェクトを作成し、パッケージをインストールする

プロジェクトの新規作成

スタート画面からNew Projectをクリック
2016-10-10.png

Visual C++を選択

なんでもいいので、テンプレートのVisual C++のタブからテンプレートを選択してOKをクリック
2016-10-10 (1).png

Universal Windows Platform Toolsをインストール

ポップアップのInstallをクリック
2016-10-10 (2).png

CMakeのエラーが解消されていることを確認

以上でC++のコンパイラがインストールされるので、CMakeが通るはず。

File > Delete Cacheでキャッシュを削除してからConfigureをクリック

2016-10-10 (6).png

21
10
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
21
10