0

I have Visual Studio 2015 community installed. I want to use cmake to compile using Visual Studio C++ compiler.

When run cmake command, I got this error:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:5 (project):
  No CMAKE_C_COMPILER could be found.

How can I specific the path of VC++ compiler?

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
Andiana
  • 1,912
  • 5
  • 37
  • 73
  • That answers said about create a C++ project in VS 2015, so that VS install C++ compiler and download C++ packgage, I haved them full installed before, I can create C++ project and run without have to install any addition things. – Andiana Jan 05 '16 at 03:13
  • Did you try running cmake from a visual studio command prompt? Not sure if the community version has that. I usually do my cmake generation in a Visual Studio command prompt. – drescherjm Jan 05 '16 at 03:20
  • Yes, I ran it in VS command promt to, it's a .bat file which call cmake from inside. VS community have Developer command promt, the community have all functions of a professional version, so I don't think its because missing function of VS. – Andiana Jan 05 '16 at 03:36
  • What generator are you specifying? – James Adkison Jan 05 '16 at 03:37
  • Is "generator" mean "compiler"? I am pretty confused. – Andiana Jan 05 '16 at 03:39
  • 1
    `-G` specifies the generator: `cmake -G "Visual Studio 14 2015"` and `cmake -G "Visual Studio 14 2015 Win64"` work for me. – James Adkison Jan 05 '16 at 03:40
  • Could you give some extra help please? This is the git project of and .net native compiler project, https://github.com/dotnet/coreclr, I am following its documentation but when run the build.bat file I got that error. I don't know where to put the -G param in that build.bat :( – Andiana Jan 05 '16 at 03:43
  • `build.cmd` has a `:GenVSSolution` label which calls `src/pal/tools/gen-buildsys-win.bat` and this batch script is already specifying the `-G` option, see line 32 and 34. – James Adkison Jan 05 '16 at 03:57
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/99750/discussion-between-verdana-and-james-adkison). – Andiana Jan 05 '16 at 04:16
  • 1
    What's your CMake version? Older version don't know about VS 2015. – usr1234567 Jan 05 '16 at 06:26
  • I am using the latest version 3.4.1 – Andiana Jan 06 '16 at 01:57

0 Answers0