CMake error at CMakeLists.txt:30 (project): No CMA

2018-12-31 22:02发布

I'm trying make a Visual Studio solution with CMake to compile the latest version of aseprite and CMake keeps giving me the:

No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.

I've already downloaded GCC, and I'm using Visual Studio 2015.

I'm following this tutorial:

https://github.com/aseprite/aseprite/blob/master/INSTALL.md

16条回答
人气声优
2楼-- · 2018-12-31 22:44

None of the solutions here solves my problem - only when I install Windows Update for universal C runtime.

Now CMake is working and no more link hangs from Visual Studio.

Update for Universal C Runtime in Windows

查看更多
笑指拈花
3楼-- · 2018-12-31 22:45

This happened to me after I installed Visual Studio 15 2017.

The C++ compiler for Visual Studio 14 2015 was not the problem. It seemed to be a problem with the Windows 10 SDK.

Adding the Windows 10 SDKs to Visual Studio 14 2015 solved the problem for me.

See attached screenshot.

Enter image description here

查看更多
浮光初槿花落
4楼-- · 2018-12-31 22:47

You can also make sure you are the sudo user and you have READ/WRITE access on the directory you are working. I had a similar problem on OS X, and I got it fixed just by entering in sudo mode.

查看更多
回忆,回不去的记忆
5楼-- · 2018-12-31 22:50

I updated Visual Studio 2015 update 2 to Visual Studio 2015 update 3, and it solved my problem.

查看更多
余生无你
6楼-- · 2018-12-31 22:53

I also experienced this error when working with CMake:

No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.

The 'warning' box in the MSDN library article Visual C++ in Visual Studio 2015 gave me the help that I needed.

Visual Studio 2015 doesn't come with C++ installed by default. So, creating a new C++ project will prompt you to download the necessary C++ components.

查看更多
素衣白纱
7楼-- · 2018-12-31 22:53

For me, this problem went away on Windows when I moved my project to a shallower parent directory, i.e. to:

C:\Users\spenc\Desktop\MyProjectDirectory

instead of

C:\Users\spenc\Desktop\...\MyProjectDirectory.

I think the source of the problem was that MSBuild has a file path length restriction to 260 characters. This causes the basic compiler test CMake performs to build a project called CompilerIdCXX.vcxproj to fail with the error:

C1083: Cannot open source file: 'CMakeCXXCompilerId.cpp'

because the length of the file's path e.g.

C:\Users\spenc\Desktop\...\MyProjectDirectory\build\CMakeFiles\...\CMakeCXXCompilerId.cpp

exceeds the MAX_PATH restriction.

CMake then concludes there is no CXX compiler.

查看更多
登录 后发表回答