CMake cannot identify C compiler from installed Vi

2019-06-25 08:16发布

I have been trying to install CMake for vtk, but I'm getting this error message:

The C compiler identification is unknown,The CXX compiler identification is unknown.

I'm using CMake 3.2.1, vtk 6.2.0 and Visual Studio 2015.

Screenshot

3条回答
倾城 Initia
2楼-- · 2019-06-25 09:07

Please take a look at this answer if it helps: CMake does not find Visual C++ compiler

Basically VS2015 doesn't install Cx compilers by default. Creating a C++ project in VS2015 will force VS to download necessary compilers.

查看更多
爷、活的狠高调
3楼-- · 2019-06-25 09:08
  • Open developer command prompt from visual studio tools.
  • reach to the directory where your cmake exe resides.
  • Run it.
  • Hopefully, now it will find the c and cxx compiler and run as desired.
查看更多
成全新的幸福
4楼-- · 2019-06-25 09:19

here is what worked for me:

  1. Relaunch Visual Studio 2015 install
  2. Choose "modify"
  3. Check that both this components are installed: "Common tools for visual c++ 2015" AND "Tools and Windows XX SDK"
  4. If not, check and choose "update"

Once I installed this components, CMake was able to detect the C/C++ compiler.

查看更多
登录 后发表回答